Overview
There are two providers:discord and roblox. You must complete the Discord OAuth flow first — it creates your CA Colombia account and issues your session cookies. Once a Discord session exists, you can link your Roblox account by running the same flow with provider=roblox.
Both flows use the same two endpoints:
Step-by-Step
1
Initiate the OAuth flow
Send a Request body
POST request to /v1/oauth/:provider with your redirectUrl. The server generates a unique state token, caches it, and returns a targetUrl — the provider’s authorization page — alongside the state value.Response body
redirectUrl must belong to a domain that is registered with CA Colombia. Passing an unregistered domain returns 403 Forbidden with "Unwhitelisted redirectUrl". Contact the CA Colombia team to register your domain.2
Redirect the user to the provider
Send the user to the
targetUrl you received in the previous step. This is the Discord (or Roblox) authorization page where the user grants permission. You do not need to do anything else at this point — the provider handles the interaction entirely.3
Handle the callback
After the user authorizes (or denies) access, the provider redirects them back to your The server validates the
redirectUrl with two query parameters appended: state and code. The CA Colombia server then processes these at GET /v1/oauth/:provider.state against the cached value from Step 1, exchanges the code for provider tokens, and looks up or creates the user’s CA Colombia account. If the user already has valid session cookies, those tokens are refreshed rather than replaced.If anything goes wrong (invalid state, expired session, failed token exchange), the server redirects to the CA Colombia root domain rather than returning an error response. Your application should detect an absent or failed state parameter on the redirect destination and prompt the user to retry.4
Session is active
On success, the server sets two
HttpOnly session cookies and redirects the browser to your redirectUrl:Your
redirectUrl also receives the state value as a query parameter so you can confirm which authorization attempt completed. From this point on, all requests that include these cookies are authenticated.Linking a Roblox Account
Once your Discord session is established, run the same flow withprovider=roblox. The server detects your existing session and attaches the Roblox identity to your account rather than creating a new one.
Attempting the Roblox flow without an active Discord session returns an error. Always complete the Discord flow first.
