pub struct OAuthUserIdentityProvider { /* private fields */ }
Expand description

An identity provider, backed by an OAuth server, that returns a user’s Biome ID

This provider uses an OAuthUserSessionStore as a cache of identities. The session store tracks all OAuth users’ sessions with a “last authenticated” timestamp. Sessions are initially added by the OAuth REST API endpoints when a user logs in.

If the session has not been authenticated within the re-authentication interval, the user will be re-authenticated using the internal OAuthClient and the session will be updated in the session store. If re-authentication fails, the session will be removed from the store and the user will need to start a new session by logging in.

This identity provider will also use a session’s refresh token (if it has one) to get a new OAuth access token for the session as needed.

This provider only accepts AuthorizationHeader::Bearer(BearerToken::OAuth2(token)) authorizations, and the inner token must be a valid Splinter access token for an OAuth user.

Implementations

Creates a new OAuth user identity provider

Arguments
  • oauth_client - The OAuth client that will be used to check if a session is still valid
  • oauth_user_session_store - The store that tracks users’ sessions
  • reauthentication_interval - The amount of time since the last authentication for which the identity provider can assume the session is still valid. If this amount of time has elapsed since the last authentication of a session, the session will be re-authenticated by the identity provider. If not provided, the default will be used (1 hour).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Attempts to get the identity that corresponds to the given authorization header. This method will return Ok(None) if the identity provider was not able to resolve the authorization to an identity. Read more

Clone implementation for IdentityProvider. The implementation of the Clone trait for Box<dyn IdentityProvider> calls this method. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert self to an expression for Diesel’s query builder. Read more

Convert &self to an expression for Diesel’s query builder. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more