pub struct ImdsManagedIdentityCredential { /* private fields */ }
Expand description
Attempts authentication using a managed identity that has been assigned to the deployment environment.
This authentication type works in Azure VMs, App Service and Azure Functions applications, as well as the Azure Cloud Shell
Built up from docs at https://docs.microsoft.com/azure/app-service/overview-managed-identity#using-the-rest-protocol
Implementations§
source§impl ImdsManagedIdentityCredential
impl ImdsManagedIdentityCredential
sourcepub fn new(http_client: Arc<dyn HttpClient>) -> Self
pub fn new(http_client: Arc<dyn HttpClient>) -> Self
Creates a new ImdsManagedIdentityCredential
using the given HttpClient
.
sourcepub fn with_object_id<A>(self, object_id: A) -> Self
pub fn with_object_id<A>(self, object_id: A) -> Self
Specifies the object id associated with a user assigned managed service identity resource that should be used to retrieve the access token.
The values of client_id
and msi_res_id
are discarded, as only one id parameter may be set when getting a token.
sourcepub fn with_client_id<A>(self, client_id: A) -> Self
pub fn with_client_id<A>(self, client_id: A) -> Self
Specifies the application id (client id) associated with a user assigned managed service identity resource that should be used to retrieve the access token.
The values of object_id
and msi_res_id
are discarded, as only one id parameter may be set when getting a token.
sourcepub fn with_identity<A>(self, msi_res_id: A) -> Self
pub fn with_identity<A>(self, msi_res_id: A) -> Self
Specifies the ARM resource id of the user assigned managed service identity resource that should be used to retrieve the access token.
The values of object_id
and client_id
are discarded, as only one id parameter may be set when getting a token.
Trait Implementations§
source§impl TokenCredential for ImdsManagedIdentityCredential
impl TokenCredential for ImdsManagedIdentityCredential
source§fn get_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scopes: &'life1 [&'life2 str]
) -> Pin<Box<dyn Future<Output = Result<AccessToken>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scopes: &'life1 [&'life2 str]
) -> Pin<Box<dyn Future<Output = Result<AccessToken>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
AccessToken
for the specified resource