Class AppRoleAuthentication
java.lang.Object
org.springframework.vault.authentication.AppRoleAuthentication
- All Implemented Interfaces:
AuthenticationStepsFactory
,ClientAuthentication
public class AppRoleAuthentication
extends Object
implements ClientAuthentication, AuthenticationStepsFactory
AppRole implementation of
ClientAuthentication
. RoleId and SecretId (optional)
are sent in the login request to Vault to obtain a VaultToken
.
AppRoleAuthentication
can be configured for push and pull mode by setting
AppRoleAuthenticationOptions.getSecretId()
.
- Author:
- Mark Paluch, Vincent Le Nair, Christophe Tafani-Dereeper
- See Also:
-
Constructor Summary
ConstructorDescriptionAppRoleAuthentication
(AppRoleAuthenticationOptions options, RestOperations restOperations) -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationSteps
Creates aAuthenticationSteps
for AppRole authentication givenAppRoleAuthenticationOptions
.Get theAuthenticationSteps
describing an authentication flow.login()
Return aVaultToken
.
-
Constructor Details
-
AppRoleAuthentication
- Parameters:
options
- must not be null.restOperations
- must not be null.
-
-
Method Details
-
createAuthenticationSteps
Creates aAuthenticationSteps
for AppRole authentication givenAppRoleAuthenticationOptions
.- Parameters:
options
- must not be null.- Returns:
AuthenticationSteps
for AppRole authentication.- Since:
- 2.0
-
login
Description copied from interface:ClientAuthentication
Return aVaultToken
. This method can optionally log into Vault to obtain atoken
.- Specified by:
login
in interfaceClientAuthentication
- Returns:
- a
VaultToken
.
-
getAuthenticationSteps
Description copied from interface:AuthenticationStepsFactory
Get theAuthenticationSteps
describing an authentication flow.- Specified by:
getAuthenticationSteps
in interfaceAuthenticationStepsFactory
- Returns:
- the
AuthenticationSteps
describing an authentication flow.
-