pub type ClientCredsClient<A> = Client<A, ClientCredsFlow>;Expand description
A client created using the Client Credentials Flow.
Aliased Type§
pub struct ClientCredsClient<A> {
pub auto_refresh: bool,
/* private fields */
}Fields§
§auto_refresh: boolDictates whether or not the client will request a new token when the current one is about the expire.
It will check if the token has expired in every request.
Implementations§
Source§impl ClientCredsClient<Unauthenticated>
impl ClientCredsClient<Unauthenticated>
Sourcepub async fn authenticate(
client_id: impl Into<String>,
client_secret: impl Into<String>,
) -> Result<ClientCredsClient<Token>>
pub async fn authenticate( client_id: impl Into<String>, client_secret: impl Into<String>, ) -> Result<ClientCredsClient<Token>>
This will exchange the client credentials for an access token used to make requests.
This authentication method doesn’t allow for token refreshing or to access user resources.
Source§impl ClientCredsClient<Token>
impl ClientCredsClient<Token>
Sourcepub async fn from_access_token(
client_id: impl Into<String>,
client_secret: impl Into<String>,
token: Token,
) -> Result<Self>
pub async fn from_access_token( client_id: impl Into<String>, client_secret: impl Into<String>, token: Token, ) -> Result<Self>
Create a new authenticated client from an access token. This client will not be able to access user data.
This method will fail if the access token is invalid (a request will be sent to check the token).