Learn how to authenticate your users with QuickBlox.
Session Token Type | Description |
---|---|
Application session token | This kind of access token is needed to read the app data. Has only READ access to resources. The expiration time after the last REST API request is 2 hours. |
User session token | The user token is the most commonly used type of token. This kind of access token is needed any time the app calls an API to read, modify or write a specific user’s data on their behalf. Has READ/WRITE access to resources. The expiration time after the last REST API request is 2 hours. |
create()
method.
Parameters | Description |
---|---|
provider | Authentication provider. |
keys | Access keys:- token. The access token received from the social network after a user authenticates with it.- secret. A social network provider’s access token secret. |
login()
method and pass authParams
to it. The ID token of the Firebase user is received as a result of the getIdToken()
method.
login()
method.
Arguments | Required | Description |
---|---|---|
authParams | yes | Specifies Firebase authentication parameters that should be set. |
authParams
object includes the following fields.
Fields | Description |
---|---|
provider | Authentication provider. Possible values: facebook, firebase_phone. |
firebase_phone | Specifies the firebase_phone object fields that should be set:- project_id. Firebase project ID. When you create a Firebase project, Firebase automatically assigns a unique ID to the project, but you can edit it during the project setup.- access_token. ID token of the Firebase user. Created by Firebase when a user signs in to an app. This token is received as a result of getIdToken() method. |
logout()
method.
Required session does not exist
. In this case, you have to recreate the session token.
In JS SDK since version 2.14.1 we have a listener to find if the session token has expired.
startSessionWithToken(sessionToken, callBack)
method. It’s can be application or user token. Don’t forget to Init and log in user if you pass the application token.