Expand description
Client Credentials
Flow
ⓘ
let client_resp = ClientAuthRequestBuilder::builder()
.set_client_id(client_id)
.set_client_secret(client_secret)
.make_request()
.await;
match client_resp {
Ok(resp) => {
let (token, expiration) = resp.into();
eprintln!("Got Token {}. (Expires in {} seconds)", token, expiration);
}
Err(RequestError::MalformedRequest(msg)) =>
unreachable!("We set all the parameters but the struct said {}", msg),
Err(RequestError::ErrorCodes(code)) =>
eprintln!("Server rejected request for reason {}", code),
Err(e) =>
eprintln!("Failed to make request for reason {}", e),
}
Structs§
- Client
Auth Request - Request for the
client authentication
flow.
See module level documentation for usage. - Client
Auth Response - Response from a successful
ClientAuthRequest
- Client
Auth Token - Represents an authorization token header for requests