Getting Started with OAuth

Log in with Role2 account

To make your app support "Log in with Role2 account", follow these steps:

  • Create an app on the App Management page, and you'll get the app_id.
  • Add a regular secret key (not a secure secret key) to your app, and you'll get the app_secret.
  • Redirect the user to: https://www.role2.com/auth/oauth?oauth_redirect_uri=https://www.your-domain.com/callback.
  • After the user logs in, they will be redirected to the specified address with a temporary code, for example: https://www.your-domain.com/callback?code=8hYt692Ppo90a.
  • Retrieve the user's token using https://role2.api.role2.com/call/oauth/access_token,
    • Parameters:
      • app_id - app identifier
      • app_secret - app secret
      • code - the code parameter received through the callback URL
    • Returns:
      • type - token type
      • authorization - token value
      • signer - account basic information