Struct graph_oauth::DeviceCodeCredential
source · 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: ToString, I: IntoIterator<Item = U>>( client_id: impl AsRef<str>, device_code: impl AsRef<str>, scope: I ) -> DeviceCodeCredential
pub fn with_refresh_token<T: AsRef<str>>( &mut self, refresh_token: T ) -> &mut Self
pub fn with_device_code<T: AsRef<str>>(&mut self, device_code: T) -> &mut Self
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) -> Self
fn from(value: DeviceCodeCredential) -> Self
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<Self::Token, AuthExecutionError>
fn get_token_silent_async<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Self::Token, AuthExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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) -> IdentityResult<Url>
fn form_urlencode(&mut self) -> IdentityResult<HashMap<String, String>>
fn client_id(&self) -> &Uuid
fn azure_cloud_instance(&self) -> AzureCloudInstance
fn app_config(&self) -> &AppConfig
fn request_parts(&mut self) -> IdentityResult<AuthorizationRequestParts>
fn build_request(&mut self) -> AuthExecutionResult<RequestBuilder>
fn build_request_async(&mut self) -> AuthExecutionResult<RequestBuilder>
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) -> AuthExecutionResult<Response>
fn execute_async<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = AuthExecutionResult<Response>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: '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