public class AzureMsiAuthentication extends Object implements ClientAuthentication, AuthenticationStepsFactory
Azure MSI authentication uses AzureVmEnvironment
and the MSI OAuth2 token
(referenced as JWT token in Vault docs) to log into Vault. VM environment and OAuth2
token are fetched from the Azure Instance Metadata service. Instances of this class are
immutable once constructed.
AzureMsiAuthenticationOptions
,
RestOperations
,
Auth Backend: azureConstructor and Description |
---|
AzureMsiAuthentication(AzureMsiAuthenticationOptions options,
org.springframework.web.client.RestOperations restOperations)
Create a new
AzureMsiAuthentication . |
AzureMsiAuthentication(AzureMsiAuthenticationOptions options,
org.springframework.web.client.RestOperations vaultRestOperations,
org.springframework.web.client.RestOperations azureMetadataRestOperations)
Create a new
AzureMsiAuthentication specifying
AzureMsiAuthenticationOptions , a Vault and an Azure-Metadata-specific
RestOperations . |
Modifier and Type | Method and Description |
---|---|
static AuthenticationSteps |
createAuthenticationSteps(AzureMsiAuthenticationOptions options)
Creates a
AuthenticationSteps for Azure authentication given
AzureMsiAuthenticationOptions . |
protected static AuthenticationSteps |
createAuthenticationSteps(AzureMsiAuthenticationOptions options,
AzureVmEnvironment environment) |
AuthenticationSteps |
getAuthenticationSteps()
Get the
AuthenticationSteps describing an authentication flow. |
VaultToken |
login()
Return a
VaultToken . |
public AzureMsiAuthentication(AzureMsiAuthenticationOptions options, org.springframework.web.client.RestOperations restOperations)
AzureMsiAuthentication
.options
- must not be null.restOperations
- must not be null.public AzureMsiAuthentication(AzureMsiAuthenticationOptions options, org.springframework.web.client.RestOperations vaultRestOperations, org.springframework.web.client.RestOperations azureMetadataRestOperations)
AzureMsiAuthentication
specifying
AzureMsiAuthenticationOptions
, a Vault and an Azure-Metadata-specific
RestOperations
.options
- must not be null.vaultRestOperations
- must not be null.azureMetadataRestOperations
- must not be null.public static AuthenticationSteps createAuthenticationSteps(AzureMsiAuthenticationOptions options)
AuthenticationSteps
for Azure authentication given
AzureMsiAuthenticationOptions
.options
- must not be null.AuthenticationSteps
for Azure authentication.protected static AuthenticationSteps createAuthenticationSteps(AzureMsiAuthenticationOptions options, @Nullable AzureVmEnvironment environment)
public VaultToken login() throws VaultException
ClientAuthentication
VaultToken
. This method can optionally log into Vault to obtain a
token
.login
in interface ClientAuthentication
VaultToken
.VaultException
public AuthenticationSteps getAuthenticationSteps()
AuthenticationStepsFactory
AuthenticationSteps
describing an authentication flow.getAuthenticationSteps
in interface AuthenticationStepsFactory
AuthenticationSteps
describing an authentication flow.Copyright © 2016–2024 Pivotal Software, Inc.. All rights reserved.