glow_auth/token_request
Token Request functions.
Types
Confidential clients or other clients issued client credentials can authenticate with the authorization server by means of auth header or the request body.
pub type AuthScheme {
AuthHeader
RequestBody
}
Constructors
-
AuthHeader
Clients in possession of a client password MAY use the HTTP Basic authentication scheme as defined in [RFC2617] to authenticate with the authorization server. The client identifier is encoded using the “application/x-www-form-urlencoded” encoding.
-
RequestBody
Alternatively, the authorization server MAY support including the client credentials in the request-body (client_id and client_secret).
Functions
pub fn add_auth(rb: TokenRequestBuilder(a), client: Client(b), auth_scheme: AuthScheme) -> TokenRequestBuilder(
a,
)
Add auth by means of either AuthHeader or RequestBody
pub fn add_auth_to_body(client: Client(a), rb: TokenRequestBuilder(
b,
)) -> TokenRequestBuilder(b)
Add the client id and secret params to the token TokenRequestBuilder
Use this when posting the auth in the request body.
pub fn add_basic_auth_header(client: Client(a), request: Request(
b,
)) -> Request(b)
Add base64 encoded authorization
header for basic auth.
Use this when sending the auth in the request headers.
pub fn authorization_code(client: Client(a), token_uri: UriAppendage, code: String, redirect_uri: Uri) -> Request(
String,
)
Build a token request using a code in Authorization Code grant.
Notes:
- The redirect_uri must be identical to usage in the Authorization Uri.
pub fn client_credentials(client: Client(a), token_uri: UriAppendage, auth_scheme: AuthScheme) -> Request(
String,
)
Build a token request using just the client id/secret in Client Credentials grant
pub fn refresh(client: Client(a), token_uri: UriAppendage, refresh_token: String) -> Request(
String,
)
Build a token request using a Refresh token