pusher / docs

The all new Pusher docs, powered by @11ty and @vercel
https://pusher.com/docs
8 stars 15 forks source link

Authenticated Users: Beams Token only available via SDK? #122

Closed yguenduez closed 3 years ago

yguenduez commented 3 years ago

Hello there, you described how you can couple a DeviceID with an arbitrary unique UserId in the https://pusher.com/docs/beams/concepts/authenticated-users/ section. To accomplish that, I need a Beams Token generated by an SDK.

The thing is I am writing the server as a Rust application, which has not an SDK yet. Is there a way to fetch the Beams Token via a request? Or can you describe a way, what it should look like, if I want to create it myself together with the secret I have?

benw-pusher commented 3 years ago

Hi, You should be able to create a new token. The best examples of how to achieve this would be to look at how our existing libraries handle this. See here for how our Java Library does it for an example. It is simply a case of using the correct subject and issuer for the generated JWT, along with signing the JWT with your secret key.

yguenduez commented 3 years ago

Thanks, that info helped a lot! I'll close this issue then.