Trait oxide_auth::code_grant::accesstoken::Request
source · pub trait Request {
// Required methods
fn valid(&self) -> bool;
fn code(&self) -> Option<Cow<'_, str>>;
fn authorization(&self) -> Option<(Cow<'_, str>, Cow<'_, [u8]>)>;
fn client_id(&self) -> Option<Cow<'_, str>>;
fn redirect_uri(&self) -> Option<Cow<'_, str>>;
fn grant_type(&self) -> Option<Cow<'_, str>>;
fn extension(&self, key: &str) -> Option<Cow<'_, str>>;
// Provided method
fn allow_credentials_in_body(&self) -> bool { ... }
}
Expand description
Trait based retrieval of parameters necessary for access token request handling.
Required Methods§
sourcefn valid(&self) -> bool
fn valid(&self) -> bool
Received request might not be encoded correctly. This method gives implementors the chance to signal that a request was received but its encoding was generally malformed. If this is the case, then no other attribute will be queried. This method exists mainly to make frontends straightforward by not having them handle special cases for malformed requests.
sourcefn code(&self) -> Option<Cow<'_, str>>
fn code(&self) -> Option<Cow<'_, str>>
The authorization code grant for which an access token is wanted.
User:password of a basic authorization header.
sourcefn client_id(&self) -> Option<Cow<'_, str>>
fn client_id(&self) -> Option<Cow<'_, str>>
The client_id, optional parameter for public clients.
sourcefn redirect_uri(&self) -> Option<Cow<'_, str>>
fn redirect_uri(&self) -> Option<Cow<'_, str>>
Valid request have the redirect url used to request the authorization code grant.
sourcefn grant_type(&self) -> Option<Cow<'_, str>>
fn grant_type(&self) -> Option<Cow<'_, str>>
Valid requests have this set to “authorization_code”
Provided Methods§
sourcefn allow_credentials_in_body(&self) -> bool
fn allow_credentials_in_body(&self) -> bool
Credentials in body should only be enabled if use of HTTP Basic is not possible.
Allows the request body to contain the client_secret
as a form parameter. This is NOT
RECOMMENDED and need not be supported. The parameters MUST NOT appear in the request URI
itself.
Under these considerations, support must be explicitely enabled.