Class UsernamePasswordAuthentication
java.lang.Object
org.springframework.vault.authentication.UsernamePasswordAuthentication
- All Implemented Interfaces:
AuthenticationStepsFactory
,ClientAuthentication
public class UsernamePasswordAuthentication
extends Object
implements ClientAuthentication, AuthenticationStepsFactory
Username and password implementation of
ClientAuthentication
. Can be used for
userpass
, ldap
, okta
, and radius
authentication
backends.- Since:
- 2.4
- Author:
- Mikhael Sokolov, Mark Paluch
- See Also:
-
Constructor Summary
ConstructorDescriptionUsernamePasswordAuthentication
(UsernamePasswordAuthenticationOptions options, RestOperations restOperations) -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationSteps
Creates aAuthenticationSteps
for username/password authentication givenUsernamePasswordAuthenticationOptions
.Get theAuthenticationSteps
describing an authentication flow.login()
Return aVaultToken
.
-
Constructor Details
-
UsernamePasswordAuthentication
public UsernamePasswordAuthentication(UsernamePasswordAuthenticationOptions options, RestOperations restOperations)
-
-
Method Details
-
createAuthenticationSteps
public static AuthenticationSteps createAuthenticationSteps(UsernamePasswordAuthenticationOptions options) Creates aAuthenticationSteps
for username/password authentication givenUsernamePasswordAuthenticationOptions
.- Parameters:
options
- must not be null.- Returns:
AuthenticationSteps
for username/password authentication.
-
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
. - Throws:
VaultException
-
getAuthenticationSteps
Description copied from interface:AuthenticationStepsFactory
Get theAuthenticationSteps
describing an authentication flow.- Specified by:
getAuthenticationSteps
in interfaceAuthenticationStepsFactory
- Returns:
- the
AuthenticationSteps
describing an authentication flow.
-