Custom Token Authentication
Authenticate using a server generated JWT token
With Firebase, you can also authenticate using a custom token that's been generated on your server. It works like this:
The user authenticates with your server
The server generates a new authentication token based on the user's unique ID
The token is passed back to the client and into the Chat SDK
Generating the token
To generate a token, you should follow the Firebase custom authentication guide.
Firebase also has an Admin SDK for Node.js, Java, Python and Go which makes the process more straightforward. you can install it using this guide.
In PHP, an implementation may look like this:
The id
should be the id
your server uses to identify the user who is currently logged in. This token should be passed back to the app.
Authenticating on the client
Last updated