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
The OAuth client identifier provided during client registration
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.
Must be
code for authorization code flowAn opaque value used to maintain state between the request and callback. This prevents CSRF attacks. Should be a random, unguessable string.
PKCE code challenge derived from the code verifier using SHA-256
Must be
S256 (SHA-256 hashing). Plain code challenges are not supported.Space-separated list of scopes requested. If not provided, defaults to
openid email profile.Available scopes:openid- OpenID Connect authenticationemail- Access to user email addressprofile- 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 theredirect_uri with the authorization code:
Redirect Parameters
| Parameter | Type | Description |
|---|---|---|
code | string | Authorization code to exchange for tokens (expires in 10 minutes) |
state | string | The same state value provided in the authorization request |
Error (400 Bad Request)
If validation fails, an HTML error page is displayed with the error details:Error Codes
| Error Code | Description |
|---|---|
invalid_request | Missing or invalid required parameter |
invalid_client | Client not found or inactive |
unsupported_response_type | Response type is not code |
Flow Diagram
Example Request
PKCE Implementation
Generating Code Verifier and Challenge
Generating Code Verifier and Challenge
Security Considerations
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.
