UXLINK OAuth 2.0
Overview
Developers can integrate UXLINK Account data into their Dapps by using UXLINK OAuth 2.0. UXLINK OAuth 2.0 allows Dapps to obtain prioritized access to HTTP services. By integrating UXLINK OAuth 2.0, users can securely and conveniently login to Dapps using their UXLINK-connected social accounts or popular digital wallets.
Prerequisite
Before you begin, please ensure you have the following items ready:
β’ Dapp ID and Dapp Key - apply through π UXLINK official account π
β’ Understanding of the OAuth 2.0 flow
Step 1: Register Your Application
β’ Provide Application Information
β’ Project Email: Used to receive development account information and API updates
β’ Project Name
β’ Project Domain: The main URL of your application, where users can learn more about your service.
β’ Logo Image URL: A URL pointing to your logo image, which will be displayed during the authentication process.
β’ Dapp Redirect URL : Refers to the URL to which the user will be redirected after completing authentication. After receiving this information, we will set up your OAuth configuration and provide you with the Dapp ID and Dapp key. Please keep this information.
Step 2: Use OAuth 2.0 Flow
β’ The application presents the UXLINK authorization page.
β’ The user clicks the login button.
β’ The current web browser is redirected to the authorization page.
β’ The user is redirected back to the redirect URL controlled by the application, passing the userβs preferred information.
Authorization Request
Build and redirect users to the UXLINK authorization page to initiate the authentication process:
ParamοΌ
dappId: The id assigned to your dapp .
redirectUrl: After authorization, UXLINK auth2.0 will redirect the URL to the user.
responseType: The value is "code".
scope: The value is "user.read".
state: A unique status value generated by your application to mitigate CSRF attacks.
After successful login and authorization, the user will be redirected to the provided URL, with special code and state value generated by your application.
Get user resource
After users authorize your application, they redirect redirectUrl to your application with parameters. Please exchange the code for an access token. This method must use basic authentication.
Get user account info
Use the following command to retrieve detailed user information:
Conclusion
This guide Outlines the process of securely integrating UXLINK OAuth 2.0 into your applications to enhance the user authentication experience.
Last updated