Skip to main content
client.create_RSO_link(redirect_uri, client_id, response_type, scopes, login_hint=None, ui_locales=None, state=None)
Constructs a Riot Sign-On (RSO) OAuth authorization URL. This is a synchronous method — no await needed.
ParameterTypeDescription
redirect_uristrOAuth2 callback URL
client_idstrYour RSO application’s client ID
response_typestrOAuth2 response type, typically "code"
scopeslist[str]Scopes to request. Must include openid. Additional: cpid, offline_access
login_hintstr, optionalPre-populate login page data
ui_localeslist[str], optionalPreferred UI locales in order
statestr, optionalOpaque value returned to your redirect URI for CSRF protection
Returns: str — the constructed authorization URL

Example

import valaw
import secrets

client = valaw.Client("YOUR_TOKEN", "americas")

# Generate a CSRF state token
state_token = secrets.token_urlsafe(32)

auth_url = client.create_RSO_link(
    redirect_uri="https://yourapp.com/callback",
    client_id="your-client-id",
    response_type="code",
    scopes=["openid", "cpid"],
    state=state_token
)

print(f"Redirect user to: {auth_url}")

OAuth2 Flow

  1. Call create_RSO_link to generate the authorization URL
  2. Redirect the user to that URL
  3. The user logs in and grants permissions
  4. Riot redirects back to your redirect_uri with an authorization code
  5. Exchange the code for an access token (via Riot’s token endpoint)
  6. Use the access token with GET_getByAccessToken
Always validate the state parameter in your callback to prevent CSRF attacks.