Skip to main content

Module oauth2

Module oauth2 

Source
Expand description

OAuth 2.0 API Endpoints

Handles OAuth 2.0 authorization code flow (RFC 6749), token exchange, token revocation (RFC 7009), and client metadata retrieval.

Re-exports§

pub use crate::oauth2_server::AuthorizationRequest as AuthorizeRequest;
pub use crate::oauth2_server::TokenRequest;
pub use crate::oauth2_server::TokenResponse;

Structs§

ClientInfo
Registered OAuth 2.0 client metadata.
ClientRegistrationRequest
Dynamic client registration request per RFC 7591.
EndSessionRequest
Request parameters for OpenID Connect RP-Initiated Logout.
OAuthError
OAuth error response per RFC 6749 §5.2.
RevokeRequest
OAuth 2.0 token revocation request per RFC 7009.
UserInfoResponse
OpenID Connect UserInfo response.

Functions§

authorize
GET /oauth/authorize OAuth 2.0 authorization endpoint — validates the client and redirect_uri, generates an authorization code, and redirects the user-agent back to the client (RFC 6749 §4.1.2).
end_session
OIDC RP-Initiated Logout (OpenID Connect RP-Initiated Logout 1.0).
get_client_info
GET /oauth/clients/{client_id} — return the stored metadata for a registered OAuth 2.0 client.
jwks
JSON Web Key Set (JWKS) endpoint (RFC 7517).
openid_configuration
OpenID Connect Discovery endpoint (RFC 8414 / OpenID Connect Discovery 1.0).
register_client
POST /oauth/register — dynamically register a new OAuth 2.0 client (RFC 7591).
revoke
POST /api/v1/oauth/revoke — revoke an access or refresh token.
token
POST /oauth/token — exchange an authorization code or refresh token for an access token (RFC 6749 §4.1.3, §6).
userinfo
GET /api/v1/oauth/userinfo — return claims about the authenticated user.
users_me
GET /users/me — returns the authenticated user’s profile.