OIDCRS
Full Spec Compliant OIDC Library.
Work in Progress. Please, don't use it in production.
cardo add oidcrs
Examples
The Authorization Code Flow.
- Client prepares an Authentication Request containing the desired request parameters.
- Client sends the request to the Authorization Server.
- Authorization Server Authenticates the End-User.
- Authorization Server obtains End-User Consent/Authorization.
- Authorization Server sends the End-User back to the Client with an Authorization Code.
- Client requests a response using the Authorization Code at the Token Endpoint.
- Client receives a response that contains an ID Token and Access Token in the response body.
- Client validates the ID token and retrieves the End-User's Subject Identifier.
let oidc_uri = "https://_/.well-known/openid-configuration";
let client = new
.with_scope
.with_scope
.with_scope;
let authorization_endpoint = client.build_authorization_endpoint.await?;
// redirect the user to the `authorization_endpoint` the first time
let authorization_code = client.extract_authorization_code?;
let authorization_tokens = client.fetch_authorization_tokens.await?;
println!;
println!;