Crates.io | oidcrs |
lib.rs | oidcrs |
version | 0.1.4 |
created_at | 2025-05-09 22:34:04.994106+00 |
updated_at | 2025-06-16 22:11:33.854665+00 |
description | Full Spec Compliant OIDC Library |
homepage | |
repository | https://github.com/enguidanos-soluciones-web/oidcrs |
max_upload_size | |
id | 1667838 |
size | 109,865 |
Full Spec Compliant OIDC Library.
Work in Progress. Please, don't use it in production.
cargo add oidcrs
let oidc_uri = "https://_/.well-known/openid-configuration";
let client = AuthorizationCodeFlowClient::new(oidc_uri)
.with_scope(AuthenticationRequestScope::Profile)
.with_scope(AuthenticationRequestScope::Email)
.with_scope(AuthenticationRequestScope::Unchecked("api://_/.default"));
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(&returned_url)?;
let authorization_tokens = client.fetch_authorization_tokens(&authorization_code).await?;
println!("{:?}", authorization_tokens.id_token);
println!("{:?}", authorization_tokens.access_token);