Class TokenAuthentication
java.lang.Object
org.springframework.vault.authentication.TokenAuthentication
- All Implemented Interfaces:
AuthenticationStepsFactory
,ClientAuthentication
public class TokenAuthentication
extends Object
implements ClientAuthentication, AuthenticationStepsFactory
Static Token-based
ClientAuthentication
method.- Author:
- Mark Paluch
- See Also:
-
Constructor Summary
ConstructorDescriptionTokenAuthentication
(String token) Create a newTokenAuthentication
with a statictoken
.TokenAuthentication
(VaultToken token) Create a newTokenAuthentication
with a statictoken
. -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationSteps
createAuthenticationSteps
(VaultToken token, boolean selfLookup) Creates aAuthenticationSteps
for token authentication givenVaultToken
.Get theAuthenticationSteps
describing an authentication flow.login()
Return aVaultToken
.
-
Constructor Details
-
TokenAuthentication
Create a newTokenAuthentication
with a statictoken
.- Parameters:
token
- the Vault token, must not be empty or null.
-
TokenAuthentication
Create a newTokenAuthentication
with a statictoken
.- Parameters:
token
- the Vault token, must not be null.
-
-
Method Details
-
createAuthenticationSteps
Creates aAuthenticationSteps
for token authentication givenVaultToken
.- Parameters:
token
- must not be null.selfLookup
- true to perform a self-lookup using the givenVaultToken
. Self-lookup will create aLoginToken
and provide renewability and TTL.- Returns:
AuthenticationSteps
for token 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.
-