pub struct OAuthAuthorizationFlowBuilder { /* private fields */ }Expand description
Builder for OAuthAuthorizationFlow.
Implementations§
Source§impl OAuthAuthorizationFlowBuilder
impl OAuthAuthorizationFlowBuilder
Sourcepub fn registration_options(
self,
options: OAuthClientRegistrationOptions,
) -> Self
pub fn registration_options( self, options: OAuthClientRegistrationOptions, ) -> Self
Configure available client-registration mechanisms.
Sourcepub fn pre_registered_client(
self,
client_id: impl Into<String>,
client_secret: Option<String>,
) -> Self
pub fn pre_registered_client( self, client_id: impl Into<String>, client_secret: Option<String>, ) -> Self
Configure pre-registered credentials and bind them to the issuer selected during discovery.
This is the convenient form for applications that know their client
credentials before they know which authorization-server issuer the
protected resource will advertise. It takes priority over CIMD and DCR,
just like OAuthClientRegistrationOptions::with_pre_registered.
Sourcepub fn registration_store(
self,
store: impl OAuthClientRegistrationStore + 'static,
) -> Self
pub fn registration_store( self, store: impl OAuthClientRegistrationStore + 'static, ) -> Self
Configure issuer-bound client-credential persistence.
Sourcepub fn token_store(self, store: impl OAuthTokenStore + 'static) -> Self
pub fn token_store(self, store: impl OAuthTokenStore + 'static) -> Self
Configure token persistence.
Sourcepub fn state_store(
self,
store: impl OAuthAuthorizationStateStore + 'static,
) -> Self
pub fn state_store( self, store: impl OAuthAuthorizationStateStore + 'static, ) -> Self
Configure persisted PKCE and CSRF state.
Sourcepub fn http_client(self, client: impl OAuthHttpClient) -> Self
pub fn http_client(self, client: impl OAuthHttpClient) -> Self
Configure the OAuth protocol HTTP implementation.
Sourcepub fn redirect_policy(self, policy: OAuthRedirectPolicy) -> Self
pub fn redirect_policy(self, policy: OAuthRedirectPolicy) -> Self
Configure explicit redirect handling.
Select one exact issuer when the resource advertises multiple servers.
Sourcepub fn refresh_buffer(self, buffer: Duration) -> Self
pub fn refresh_buffer(self, buffer: Duration) -> Self
Set the pre-expiry refresh buffer.
Configure automatic browser/headless authorization handling.
Sourcepub fn client_assertion_signer(
self,
signer: impl OAuthClientAssertionSigner,
) -> Self
pub fn client_assertion_signer( self, signer: impl OAuthClientAssertionSigner, ) -> Self
Configure private_key_jwt assertion signing.
Sourcepub fn build(self) -> Result<OAuthAuthorizationFlow, OAuthClientError>
pub fn build(self) -> Result<OAuthAuthorizationFlow, OAuthClientError>
Build the state machine.
§Errors
Returns an error when no redirect policy was supplied or when the default reqwest client cannot be constructed.