pub struct AuthResource { /* private fields */ }Expand description
OAuth 2.0 endpoints — /oauth/authorize, /oauth/token, /oauth/revoke.
These authenticate via client credentials carried in the request itself (per RFC 6749/7009),
independent of the client’s configured auth — token is how you obtain a bearer token.
Implementations§
Source§impl AuthResource
impl AuthResource
Sourcepub async fn token(
&self,
grant_type: &str,
req: TokenRequest,
) -> Result<OAuthTokenResponse, ManagerError>
pub async fn token( &self, grant_type: &str, req: TokenRequest, ) -> Result<OAuthTokenResponse, ManagerError>
Exchange a grant for tokens at the OAuth token endpoint. grant_type is e.g.
authorization_code, refresh_token, password, or client_credentials.
Sourcepub async fn revoke(
&self,
token: &str,
token_type_hint: Option<&str>,
client_id: Option<&str>,
client_secret: Option<&str>,
) -> Result<(), ManagerError>
pub async fn revoke( &self, token: &str, token_type_hint: Option<&str>, client_id: Option<&str>, client_secret: Option<&str>, ) -> Result<(), ManagerError>
Revoke a token (RFC 7009).
The OAuth authorization endpoint (consent / redirect). Returns the raw response body (the
authorization redirect / consent page). state and the PKCE code_challenge are optional.
A direct pass-through of the standard OAuth authorize query parameters.
Auto Trait Implementations§
impl !RefUnwindSafe for AuthResource
impl !UnwindSafe for AuthResource
impl Freeze for AuthResource
impl Send for AuthResource
impl Sync for AuthResource
impl Unpin for AuthResource
impl UnsafeUnpin for AuthResource
Blanket Implementations§
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