pub struct ClientCredentialsFlow { /* private fields */ }Expand description
Client Credentials flow helper.
§Example
use starberry_oauth::ClientCredentialsFlow;
let flow = ClientCredentialsFlow::new(
"cid",
"csecret",
"https://auth.local/token",
vec!["scopeA".to_string()]
);Implementations§
Source§impl ClientCredentialsFlow
impl ClientCredentialsFlow
Sourcepub fn new<I, Sec, U>(
client_id: I,
client_secret: Sec,
token_url: U,
scopes: impl IntoIterator<Item = String>,
) -> Self
pub fn new<I, Sec, U>( client_id: I, client_secret: Sec, token_url: U, scopes: impl IntoIterator<Item = String>, ) -> Self
Constructs a new client credentials helper.
Sourcepub async fn execute<C: OAuthHttpClient>(
&self,
http_client: &C,
) -> Result<Token, OAuthError>
pub async fn execute<C: OAuthHttpClient>( &self, http_client: &C, ) -> Result<Token, OAuthError>
Execute client credentials flow, returning an access token.
Auto Trait Implementations§
impl Freeze for ClientCredentialsFlow
impl RefUnwindSafe for ClientCredentialsFlow
impl Send for ClientCredentialsFlow
impl Sync for ClientCredentialsFlow
impl Unpin for ClientCredentialsFlow
impl UnwindSafe for ClientCredentialsFlow
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