pub struct OidcAuthorizationRequestBuilder { /* private fields */ }Expand description
Fluent builder for OidcAuthorizationRequest.
§Example
use auth_framework::server::oidc::core::OidcAuthorizationRequest;
let req = OidcAuthorizationRequest::builder("my-client", "https://app.example/callback")
.scope("openid profile email")
.state("random_state")
.nonce("random_nonce")
.build();
assert_eq!(req.client_id, "my-client");
assert_eq!(req.scope, "openid profile email");Implementations§
Source§impl OidcAuthorizationRequestBuilder
impl OidcAuthorizationRequestBuilder
Sourcepub fn response_type(self, rt: impl Into<String>) -> Self
pub fn response_type(self, rt: impl Into<String>) -> Self
Set the OAuth2 response type (default: "code").
Sourcepub fn scope(self, scope: impl Into<String>) -> Self
pub fn scope(self, scope: impl Into<String>) -> Self
Set the requested scopes (default: "openid").
Sourcepub fn state(self, state: impl Into<String>) -> Self
pub fn state(self, state: impl Into<String>) -> Self
Set the state parameter for CSRF protection.
Sourcepub fn nonce(self, nonce: impl Into<String>) -> Self
pub fn nonce(self, nonce: impl Into<String>) -> Self
Set the nonce for ID token replay protection.
Sourcepub fn login_hint(self, hint: impl Into<String>) -> Self
pub fn login_hint(self, hint: impl Into<String>) -> Self
Provide a login hint (e.g. email or username).
Sourcepub fn id_token_hint(self, hint: impl Into<String>) -> Self
pub fn id_token_hint(self, hint: impl Into<String>) -> Self
Set the id_token_hint for session management.
Sourcepub fn acr_values(self, values: impl Into<String>) -> Self
pub fn acr_values(self, values: impl Into<String>) -> Self
Set the ACR values.
Sourcepub fn build(self) -> OidcAuthorizationRequest
pub fn build(self) -> OidcAuthorizationRequest
Consume the builder and produce the request.
Auto Trait Implementations§
impl Freeze for OidcAuthorizationRequestBuilder
impl RefUnwindSafe for OidcAuthorizationRequestBuilder
impl Send for OidcAuthorizationRequestBuilder
impl Sync for OidcAuthorizationRequestBuilder
impl Unpin for OidcAuthorizationRequestBuilder
impl UnsafeUnpin for OidcAuthorizationRequestBuilder
impl UnwindSafe for OidcAuthorizationRequestBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more