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
ConstructorsConstructorDescriptionUsernamePasswordAuthentication(UsernamePasswordAuthenticationOptions options, RestOperations restOperations) -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationStepsCreates aAuthenticationStepsfor username/password authentication givenUsernamePasswordAuthenticationOptions.Get theAuthenticationStepsdescribing 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 aAuthenticationStepsfor username/password authentication givenUsernamePasswordAuthenticationOptions.- Parameters:
options- must not be null.- Returns:
AuthenticationStepsfor username/password authentication.
-
login
Description copied from interface:ClientAuthenticationReturn aVaultToken. This method can optionally log into Vault to obtain atoken.- Specified by:
loginin interfaceClientAuthentication- Returns:
- a
VaultToken. - Throws:
VaultException
-
getAuthenticationSteps
Description copied from interface:AuthenticationStepsFactoryGet theAuthenticationStepsdescribing an authentication flow.- Specified by:
getAuthenticationStepsin interfaceAuthenticationStepsFactory- Returns:
- the
AuthenticationStepsdescribing an authentication flow.
-