Method Signature
Parameters
OAuth2 callback route where the user will be redirected after authorization
Client ID of your RSO application (obtained from Riot Developer Portal)
OAuth2 response type. Should be
"code" for authorization code flowList of scopes to request. Available scopes:
openid- Required for authenticationcpid- Access to player identificationoffline_access- Enables refresh tokens for long-term access
Pre-populate data on the login page. Supported formats:
{regioncode}- e.g., “na”{regioncode}|{username}- e.g., “na|PlayerName”{regioncode}#{userid}- e.g., “na#12345”
List of BCP47 language tag values in order of preference (most to least preferred). Examples:
["en-US", "es-MX"]Opaque value for CSRF protection. The same value will be returned to your redirect_uri. Recommended for security
Returns
A fully constructed Riot Sign-On authorization URL that can be used to redirect users
Example
Advanced Example
OAuth2 Flow
- Generate RSO Link: Use this method to create the authorization URL
- Redirect User: Send the user to the generated URL
- User Authorizes: User logs in and grants permissions
- Callback: User is redirected to your
redirect_uriwith an authorization code - Exchange Code: Use the code to obtain access tokens (via Riot’s token endpoint)
- API Access: Use the access token with
GET_getByAccessToken()to retrieve user data
Scope Requirements:
openidis mandatory for authentication- Add
offline_accessif you need refresh tokens - Add
cpidfor additional player identification data
This method only generates the authorization URL. You’ll need to implement the OAuth2 callback handler separately to exchange the authorization code for access tokens.

