Skip to content

Authorization Endpoint

The authorization endpoint is where an OAuth2/OIDC flow begins. Your application redirects the user’s browser here; Kotauth handles authentication and redirects back with an authorization code.

GET /t/{slug}/protocol/openid-connect/auth

No authentication required — this endpoint is accessed by the user’s browser.

ParameterRequiredDescription
response_typeYesMust be code
client_idYesYour application’s client_id
redirect_uriYesMust exactly match a URI registered in the application. Query strings are allowed; fragments are not.
scopeYesSpace-separated scopes. Must include openid for OIDC.
stateRecommendedOpaque random value. Returned unchanged in the callback. Verify it to prevent CSRF.
nonceRecommendedRandom value included in the ID token nonce claim. Prevents replay attacks.
code_challengeRequired (public clients)base64url(sha256(code_verifier))
code_challenge_methodRequired (public clients)Must be S256
promptNologin forces re-authentication even if a session exists
GET https://auth.yourdomain.com/t/my-app/protocol/openid-connect/auth
?response_type=code
&client_id=my-spa
&redirect_uri=https%3A%2F%2Fapp.yourdomain.com%2Fcallback
&scope=openid%20profile%20email
&state=xK9mP2vL
&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
&code_challenge_method=S256

After successful authentication, Kotauth redirects to your redirect_uri:

https://app.yourdomain.com/callback
?code=SplxlOBeZQQYbYS6WxSbIA
&state=xK9mP2vL

The code is valid for 15 minutes and can be used exactly once.

If authentication fails or the user denies consent, Kotauth redirects to redirect_uri with error parameters:

https://app.yourdomain.com/callback
?error=access_denied
&error_description=User+denied+access
&state=xK9mP2vL

Common error codes:

ErrorDescription
invalid_requestMissing or malformed parameter
unauthorized_clientclient_id not registered
access_deniedUser denied or account disabled
invalid_scopeRequested scope not supported

If the redirect_uri is invalid or client_id is unknown, Kotauth shows an error page instead of redirecting — this prevents open redirect vulnerabilities.