GET
/
auth
/
login-o-auth
curl --request GET \
  --url https://codecombat.com/api/auth/login-o-auth \
  --header 'Authorization: Basic <encoded-value>'
url = `https://codecombat.com/auth/login-o-auth?provider=${OAUTH_PROVIDER_ID}&accessToken=1234`
res.redirect(url)
// User is sent to this CodeCombat URL and assuming everything checks out,
// is logged in and redirected to the home page.

In this example, we call your lookup URL (let’s say, https://oauth.provider/user?t=<%= accessToken %>) with the access token (1234). The lookup URL returns { id: 'abcd' } in this case. We will match this id with the OAuthIdentity stored in the user information in our db. If everything checks out, the user is logged in and redirected to the home page.

Authorizations

Authorization
string
headerrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Query Parameters

provider
string
required

Your OAuth Provider ID

accessToken
string | null

Will be passed through your lookup URL to get the user ID. Required if no code.

code
string | null

Will be passed to the OAuth token endpoint to get a token. Required if no accessToken.

redirect
string | null

Override where the user will navigate to after successfully logging in.

errorRedirect
string | null

If an error happens, redirects the user to this url, with at least query parameters code, errorName and message.