public class AzureMsiAuthentication extends Object implements ClientAuthentication
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,
RestOperations restOperations)
Create a new
AzureMsiAuthentication . |
AzureMsiAuthentication(AzureMsiAuthenticationOptions options,
RestOperations vaultRestOperations,
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) |
VaultToken |
login()
Return a
VaultToken . |
public AzureMsiAuthentication(AzureMsiAuthenticationOptions options, RestOperations restOperations)
AzureMsiAuthentication
.options
- must not be null.restOperations
- must not be null.public AzureMsiAuthentication(AzureMsiAuthenticationOptions options, RestOperations vaultRestOperations, 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
Copyright © 2016–2020 Pivotal Software, Inc.. All rights reserved.