Trait telescope::web::services::auth::oauth2_providers::Oauth2IdentityProvider [−][src]
pub trait Oauth2IdentityProvider {
type IdentityType: Oauth2Identity;
const SERVICE_NAME: &'static str;
fn get_client() -> Arc<BasicClient>;
fn scopes() -> Vec<Scope>ⓘ;
fn auth_response(
redir_url: RedirectUrl,
http_req: &HttpRequest
) -> Result<HttpResponse, TelescopeError> { ... }
fn token_exchange(
redirect_uri: RedirectUrl,
req: &HttpRequest
) -> Result<BasicTokenResponse, TelescopeError> { ... }
}
Expand description
Special trait specifically for OAuth2 Identity providers that implements certain methods in the IdentityProvider trait automatically.
Associated Types
The type of identity produced by this provider.
Associated Constants
const SERVICE_NAME: &'static str
const SERVICE_NAME: &'static str
Name of this identity provider. See the documentation on the
IdentityProvider
trait for requirements.
Required methods
fn get_client() -> Arc<BasicClient>
fn get_client() -> Arc<BasicClient>
Get the client configuration for this Identity Provider.
Provided methods
fn auth_response(
redir_url: RedirectUrl,
http_req: &HttpRequest
) -> Result<HttpResponse, TelescopeError>
fn auth_response(
redir_url: RedirectUrl,
http_req: &HttpRequest
) -> Result<HttpResponse, TelescopeError>
Get the redirect URL for the associated client and build an HTTP response to take the user there. Saves the CSRF token in the process.
fn token_exchange(
redirect_uri: RedirectUrl,
req: &HttpRequest
) -> Result<BasicTokenResponse, TelescopeError>
fn token_exchange(
redirect_uri: RedirectUrl,
req: &HttpRequest
) -> Result<BasicTokenResponse, TelescopeError>
Extract the response parameters from the callback request invoked by the provider’s authorization page.