Frictionless Sign-in

This guide will explain how you can Sign-in your customer to Coinify's Trade Widget without them needing to provide any credentials.

❗️

Important:

Regardless of the Sign-up method you use, you must request to generate the offlineToken.

For new users, see Frictionless Sign-up Flow and Sign-Up API request documentation.

For existing users, you can generate the offlineToken by calling Reset Offline Token endpoint, regardless if you have previously created it for the user or not.

📘

Good to know:

offlineToken can be re-used indefinitely as it does not expire.

refreshToken expires after 24 hours. A new one must be obtained to authenticate the customer anew.

Once you have received and stored your customer's offlineToken, you can use it to seamlessly authenticate the customer via Offline Token Sign-in method and receive the refresh_token in the API response. Learn more about the Authentication methods here.

Specify the "grant_type": "offline_token" in the request body of the Frictionless Sign-in API endpoint, provide the offline_token for the specific customer, and receive the refresh_token in the response. Here's an example of the request body and response body for the Frictionless Sign-in API endpoint:

{ "grant_type": "offline_token", "offline_token": "OkjLekdEzKQSDuMFpXm6dcLU1hTj1LsC2I+5a6DMm9Kq6XNjqc4694wimeI8UKN7" }
{ "access_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2OTY0OTA3NjgsImV4cCI6MTY5NjQ5MTk2OCwidWlkIjo2NzY4OCwiZXYiOmZhbHNlLCJzYyI6eyJ0XzIyMjI0IjoiKiJ9fQ.a7xi7-A1il0yDFdPamPl8q4mQValrWkeyrid5EAPzqD2WygSNC4f519pqgSH-jg5Vtmk0EtWscRbL8jS33pIdw", "token_type": "bearer", "expires_in": 1200, "refresh_token": "xR5PAGj0uPLzOP5Cgeo5ofEmAR/j2b3uRviSmH54cHfe+ZQ/PPvJoeqTT61Mv9nw" }

Now that you have the refresh_token for the specific customer, you can log them to the Trade Widget by passing the refresh token value to the refreshToken parameter supported by the Trade widget. See all the Trade Widget supported query parameters here.

Bellow is an example of the Trade Widget URL inside the iframe showing how you would pass the refresh token value from the response body example above to the Trade Widget URL:

<!DOCTYPE html> <html> <body> <h2>Trade Widget Example</h2> <p>You can use the height and width attributes to specify the size of the iframe:</p> <iframe src="https://trade-ui.sandbox.coinify.com?partnerId=24d17a54-81e6-464b-aba8-30935fc0fd3f&refreshToken=xR5PAGj0uPLzOP5Cgeo5ofEmAR%2Fj2b3uRviSmH54cHfe%2BZQ%2FPPvJoeqTT61Mv9nw" width="100%" height="700px" allow="camera;fullscreen;accelerometer;gyroscope;magnetometer" allowfullscreen></iframe> </body> </html>

Trade Widget Example

You can use the height and width attributes to specify the size of the iframe:

🚧

Important:

Make sure to encode the Trade Widget URL. Otherwise the browser might not load the Trade Widget properly.

Now that the refresh token is passed to the Trade Widget, the relevant customer behind the token does not have to go through the Sign-in page and provide their credentials.

Combining the Frictionless Sign-up Flow and the Frictionless Sign-in using the offline token creates a seamless transition between your platform and Coinify's Trade Widget for your customer which improves their experience significantly.


Did this page help you?