During enrolling Trusted Devices
During your app's registration flow, you will enroll the user's device as their first Trusted Device. On this flow, you will receive the User's information.
In addition to user information, you can also receive the OAuth Tokens when trusted device enrollment succeeds.
In you registration flow, you will enroll the user's device as their first Trusted Device. You would normally receive the user's information on the onEnrollSuccess
function.
To receive the OAuth Tokens on this request, modify your code as follows:
In your onEnrollSuccess
function, you will receive the following response:
Cotter's React Native SDK automatically store your tokens securely inside the device's secure storage.
Tokens must be stored securely within your application.
Getting and Removing tokens from the Storage
You need to pass the access_token
to your backend server on every API calls. You also need to remove the tokens from storage to log out your users. Check out how to do that here:
Renewing Expired Tokens
Access tokens and ID tokens expires in 1 hour. When they're expired, you need to use the refresh_token
to get new tokens. Check out how to renew expired tokens:
Last updated