pub struct DeviceCodeCredential { /* private fields */ }
Expand description
The device authorization grant: allows users to sign in to input-constrained devices such as a smart TV, IoT device, or a printer. To enable this flow, the device has the user visit a webpage in a browser on another device to sign in. Once the user signs in, the device is able to get access tokens and refresh tokens as needed.
For more info on the protocol supported by the Microsoft Identity Platform see the Microsoft identity platform and the OAuth 2.0 device authorization grant flow
Implementations§
Source§impl DeviceCodeCredential
impl DeviceCodeCredential
pub fn new<U, I>(
client_id: impl AsRef<str>,
device_code: impl AsRef<str>,
scope: I,
) -> DeviceCodeCredentialwhere
U: ToString,
I: IntoIterator<Item = U>,
pub fn with_refresh_token<T>( &mut self, refresh_token: T, ) -> &mut DeviceCodeCredential
pub fn with_device_code<T>( &mut self, device_code: T, ) -> &mut DeviceCodeCredential
pub fn builder(client_id: impl AsRef<str>) -> DeviceCodeCredentialBuilder
Trait Implementations§
Source§impl Clone for DeviceCodeCredential
impl Clone for DeviceCodeCredential
Source§fn clone(&self) -> DeviceCodeCredential
fn clone(&self) -> DeviceCodeCredential
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DeviceCodeCredential
impl Debug for DeviceCodeCredential
Source§impl From<DeviceCodeCredential> for PublicClientApplication<DeviceCodeCredential>
impl From<DeviceCodeCredential> for PublicClientApplication<DeviceCodeCredential>
Source§fn from(
value: DeviceCodeCredential,
) -> PublicClientApplication<DeviceCodeCredential>
fn from( value: DeviceCodeCredential, ) -> PublicClientApplication<DeviceCodeCredential>
Converts to this type from the input type.
Source§impl TokenCache for DeviceCodeCredential
impl TokenCache for DeviceCodeCredential
type Token = Token
fn get_token_silent( &mut self, ) -> Result<<DeviceCodeCredential as TokenCache>::Token, AuthExecutionError>
fn get_token_silent_async<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<<DeviceCodeCredential as TokenCache>::Token, AuthExecutionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
DeviceCodeCredential: 'async_trait,
fn with_force_token_refresh(&mut self, force_token_refresh: ForceTokenRefresh)
Source§impl TokenCredentialExecutor for DeviceCodeCredential
impl TokenCredentialExecutor for DeviceCodeCredential
fn uri(&mut self) -> Result<Url, AuthorizationFailure>
fn form_urlencode( &mut self, ) -> Result<HashMap<String, String>, AuthorizationFailure>
fn client_id(&self) -> &Uuid
fn azure_cloud_instance(&self) -> AzureCloudInstance
fn app_config(&self) -> &AppConfig
fn request_parts( &mut self, ) -> Result<AuthorizationRequestParts, AuthorizationFailure>
fn build_request(&mut self) -> Result<RequestBuilder, AuthExecutionError>
fn build_request_async(&mut self) -> Result<RequestBuilder, AuthExecutionError>
fn basic_auth(&self) -> Option<(String, String)>
fn extra_header_parameters(&self) -> &HeaderMap
fn issuer(&self) -> Result<Url, ParseError>
fn extra_query_parameters(&self) -> &HashMap<String, String>
fn execute(&mut self) -> Result<Response, AuthExecutionError>
fn execute_async<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Response, AuthExecutionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
Auto Trait Implementations§
impl Freeze for DeviceCodeCredential
impl !RefUnwindSafe for DeviceCodeCredential
impl Send for DeviceCodeCredential
impl Sync for DeviceCodeCredential
impl Unpin for DeviceCodeCredential
impl !UnwindSafe for DeviceCodeCredential
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