Class JwtAuthentication
java.lang.Object
org.springframework.vault.authentication.JwtAuthentication
- All Implemented Interfaces:
AuthenticationStepsFactory
,ClientAuthentication
public class JwtAuthentication
extends Object
implements ClientAuthentication, AuthenticationStepsFactory
JWT implementation of
ClientAuthentication
. JwtAuthentication
uses a
JSON Web Token to login into Vault. JWT and Role are sent in the login request to Vault
to obtain a VaultToken
.- Since:
- 3.1
- Author:
- Nanne Baars
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJwtAuthentication
(JwtAuthenticationOptions options, RestOperations restOperations) -
Method Summary
Modifier and TypeMethodDescriptionGet theAuthenticationSteps
describing an authentication flow.login()
Return aVaultToken
.
-
Field Details
-
DEFAULT_JWT_AUTHENTICATION_PATH
- See Also:
-
-
Constructor Details
-
JwtAuthentication
- Parameters:
options
- must not be null.restOperations
- must not be null.
-
-
Method Details
-
getAuthenticationSteps
Description copied from interface:AuthenticationStepsFactory
Get theAuthenticationSteps
describing an authentication flow.- Specified by:
getAuthenticationSteps
in interfaceAuthenticationStepsFactory
- Returns:
- the
AuthenticationSteps
describing an authentication flow.
-
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
-