pub struct ResourceOwnerPasswordCredential { /* private fields */ }
Expand description
Allows an application to sign in the user by directly handling their password. Not recommended. ROPC can also be done using a client secret or assertion, however this client implementation does not offer this use case. This is the same as all MSAL clients. https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.3
The Microsoft identity platform only supports the ROPC grant within Microsoft Entra tenants, not personal accounts. This means that you must use a tenant-specific endpoint (https://login.microsoftonline.com/{TenantId_or_Name}) or the organizations endpoint.
Implementations§
source§impl ResourceOwnerPasswordCredential
impl ResourceOwnerPasswordCredential
pub fn new( client_id: impl AsRef<str>, username: impl AsRef<str>, password: impl AsRef<str> ) -> ResourceOwnerPasswordCredential
pub fn new_with_tenant( tenant_id: impl AsRef<str>, client_id: impl AsRef<str>, username: impl AsRef<str>, password: impl AsRef<str> ) -> ResourceOwnerPasswordCredential
pub fn builder<T: AsRef<str>>( client_id: T ) -> ResourceOwnerPasswordCredentialBuilder
Trait Implementations§
source§impl Clone for ResourceOwnerPasswordCredential
impl Clone for ResourceOwnerPasswordCredential
source§fn clone(&self) -> ResourceOwnerPasswordCredential
fn clone(&self) -> ResourceOwnerPasswordCredential
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 From<ResourceOwnerPasswordCredential> for PublicClientApplication<ResourceOwnerPasswordCredential>
impl From<ResourceOwnerPasswordCredential> for PublicClientApplication<ResourceOwnerPasswordCredential>
source§fn from(value: ResourceOwnerPasswordCredential) -> Self
fn from(value: ResourceOwnerPasswordCredential) -> Self
Converts to this type from the input type.
source§impl TokenCache for ResourceOwnerPasswordCredential
impl TokenCache for ResourceOwnerPasswordCredential
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 ResourceOwnerPasswordCredential
impl TokenCredentialExecutor for ResourceOwnerPasswordCredential
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 ResourceOwnerPasswordCredential
impl !RefUnwindSafe for ResourceOwnerPasswordCredential
impl Send for ResourceOwnerPasswordCredential
impl Sync for ResourceOwnerPasswordCredential
impl Unpin for ResourceOwnerPasswordCredential
impl !UnwindSafe for ResourceOwnerPasswordCredential
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