Skip to main content

Overview

The authorization endpoint is used to initiate the OAuth 2.1 authorization flow. This endpoint presents the user with an authorization page where they can approve the agent’s access request.

Query Parameters

string
required
The OAuth client identifier provided during client registration
string
required
The URI where the user will be redirected after authorization. Must exactly match one of the registered redirect URIs for the client. Must use HTTPS except for localhost.
string
required
Must be code for authorization code flow
string
required
An opaque value used to maintain state between the request and callback. This prevents CSRF attacks. Should be a random, unguessable string.
string
required
PKCE code challenge derived from the code verifier using SHA-256
string
required
Must be S256 (SHA-256 hashing). Plain code challenges are not supported.
string
Space-separated list of scopes requested. If not provided, defaults to openid email profile.Available scopes:
  • openid - OpenID Connect authentication
  • email - Access to user email address
  • profile - Access to user profile (name)

Response

Success (302 Redirect)

If validation succeeds, the user is presented with an authorization page. After the agent authenticates via back-channel and the user approves, they are redirected to the redirect_uri with the authorization code:

Redirect Parameters

Error (400 Bad Request)

If validation fails, an HTML error page is displayed with the error details:

Error Codes

Flow Diagram

Example Request

PKCE Implementation

Security Considerations

Always use HTTPS for redirect URIs in production. HTTP is only allowed for localhost during development.
State parameter is required to prevent CSRF attacks. Generate a random, unguessable value and verify it in your callback handler.
Code verifier must be stored securely (session, cookie, or memory) and used in the subsequent token exchange request.

Next Steps

After successfully receiving an authorization code:

Exchange Code for Tokens

POST /token - Exchange the authorization code for access tokens

Get User Info

GET /userinfo - Retrieve user information using the access token