Struct graph_oauth::AuthorizationCodeCredential
source · pub struct AuthorizationCodeCredential { /* private fields */ }
Expand description
The OAuth 2.0 authorization code grant type, or auth code flow, enables a client application to obtain authorized access to protected resources like web APIs. The auth code flow requires a user-agent that supports redirection from the authorization server (the Microsoft identity platform) back to your application. For example, a web browser, desktop, or mobile application operated by a user to sign in to your app and access their data. https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
Implementations§
source§impl AuthorizationCodeCredential
impl AuthorizationCodeCredential
pub fn new( tenant_id: impl AsRef<str>, client_id: impl AsRef<str>, client_secret: impl AsRef<str>, authorization_code: impl AsRef<str> ) -> IdentityResult<AuthorizationCodeCredential>
pub fn new_with_redirect_uri( tenant_id: impl AsRef<str>, client_id: impl AsRef<str>, client_secret: impl AsRef<str>, authorization_code: impl AsRef<str>, redirect_uri: Url ) -> IdentityResult<AuthorizationCodeCredential>
pub fn with_refresh_token<T: AsRef<str>>(&mut self, refresh_token: T)
pub fn builder( authorization_code: impl AsRef<str>, client_id: impl AsRef<str>, client_secret: impl AsRef<str> ) -> AuthorizationCodeCredentialBuilder
Trait Implementations§
source§impl Clone for AuthorizationCodeCredential
impl Clone for AuthorizationCodeCredential
source§fn clone(&self) -> AuthorizationCodeCredential
fn clone(&self) -> AuthorizationCodeCredential
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 AuthorizationCodeCredential
impl Debug for AuthorizationCodeCredential
source§impl From<AuthorizationCodeCredential> for AuthorizationCodeCredentialBuilder
impl From<AuthorizationCodeCredential> for AuthorizationCodeCredentialBuilder
source§fn from(credential: AuthorizationCodeCredential) -> Self
fn from(credential: AuthorizationCodeCredential) -> Self
Converts to this type from the input type.
source§impl From<AuthorizationCodeCredential> for ConfidentialClientApplication<AuthorizationCodeCredential>
impl From<AuthorizationCodeCredential> for ConfidentialClientApplication<AuthorizationCodeCredential>
source§fn from(value: AuthorizationCodeCredential) -> Self
fn from(value: AuthorizationCodeCredential) -> Self
Converts to this type from the input type.
source§impl TokenCache for AuthorizationCodeCredential
impl TokenCache for AuthorizationCodeCredential
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 AuthorizationCodeCredential
impl TokenCredentialExecutor for AuthorizationCodeCredential
fn form_urlencode(&mut self) -> IdentityResult<HashMap<String, String>>
fn client_id(&self) -> &Uuid
fn azure_cloud_instance(&self) -> AzureCloudInstance
fn basic_auth(&self) -> Option<(String, String)>
fn app_config(&self) -> &AppConfig
fn uri(&mut self) -> IdentityResult<Url>
fn request_parts(&mut self) -> IdentityResult<AuthorizationRequestParts>
fn build_request(&mut self) -> AuthExecutionResult<RequestBuilder>
fn build_request_async(&mut self) -> AuthExecutionResult<RequestBuilder>
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 AuthorizationCodeCredential
impl !RefUnwindSafe for AuthorizationCodeCredential
impl Send for AuthorizationCodeCredential
impl Sync for AuthorizationCodeCredential
impl Unpin for AuthorizationCodeCredential
impl !UnwindSafe for AuthorizationCodeCredential
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