pub struct AzureTokenProvider { /* private fields */ }Expand description
Azure AD client-credentials grant.
Implementations§
Source§impl AzureTokenProvider
impl AzureTokenProvider
Sourcepub fn new(
tenant_id: impl Into<String>,
client_id: impl Into<String>,
client_secret: impl Into<String>,
scope: impl Into<String>,
) -> Result<Self, AuthError>
pub fn new( tenant_id: impl Into<String>, client_id: impl Into<String>, client_secret: impl Into<String>, scope: impl Into<String>, ) -> Result<Self, AuthError>
Client-credentials provider for login.microsoftonline.com/{tenant}/oauth2/v2.0/token.
Sourcepub fn with_token_url(self, token_url: impl Into<String>) -> Self
pub fn with_token_url(self, token_url: impl Into<String>) -> Self
Override the token URL (tests, national clouds).
Trait Implementations§
Source§impl Clone for AzureTokenProvider
impl Clone for AzureTokenProvider
Source§impl Debug for AzureTokenProvider
impl Debug for AzureTokenProvider
Source§impl From<AzureTokenProvider> for AnyTokenProvider
Available on crate feature net only.
impl From<AzureTokenProvider> for AnyTokenProvider
Available on crate feature
net only.Source§fn from(t: AzureTokenProvider) -> Self
fn from(t: AzureTokenProvider) -> Self
Converts to this type from the input type.
Source§impl TokenProvider for AzureTokenProvider
impl TokenProvider for AzureTokenProvider
Source§fn mark_stale(&self)
fn mark_stale(&self)
Drop the cached token so the next
TokenProvider::get_token refreshes.Source§async fn get_token(&self) -> Result<String, AuthError>
async fn get_token(&self) -> Result<String, AuthError>
Return a valid access token, refreshing if necessary.
Source§fn wake(&self)
fn wake(&self)
Host laptop-wake hook. Default calls
TokenProvider::mark_stale.Auto Trait Implementations§
impl !RefUnwindSafe for AzureTokenProvider
impl !UnwindSafe for AzureTokenProvider
impl Forget for AzureTokenProvider
impl Freeze for AzureTokenProvider
impl Send for AzureTokenProvider
impl Sync for AzureTokenProvider
impl Unpin for AzureTokenProvider
impl UnsafeUnpin for AzureTokenProvider
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