public class TokenAuthentication extends Object implements ClientAuthentication, AuthenticationStepsFactory
ClientAuthentication
method.VaultToken
,
Auth Backend: TokenConstructor and Description |
---|
TokenAuthentication(String token)
Create a new
TokenAuthentication with a static token . |
TokenAuthentication(VaultToken token)
Create a new
TokenAuthentication with a static token . |
Modifier and Type | Method and Description |
---|---|
static AuthenticationSteps |
createAuthenticationSteps(VaultToken token,
boolean selfLookup)
Creates a
AuthenticationSteps for token authentication given
VaultToken . |
AuthenticationSteps |
getAuthenticationSteps()
Get the
AuthenticationSteps describing an authentication flow. |
VaultToken |
login()
Return a
VaultToken . |
public TokenAuthentication(String token)
TokenAuthentication
with a static token
.token
- the Vault token, must not be empty or null.public TokenAuthentication(VaultToken token)
TokenAuthentication
with a static token
.token
- the Vault token, must not be null.public static AuthenticationSteps createAuthenticationSteps(VaultToken token, boolean selfLookup)
AuthenticationSteps
for token authentication given
VaultToken
.token
- must not be null.selfLookup
- true to perform a self-lookup using the given
VaultToken
. Self-lookup will create a LoginToken
and provide
renewability and TTL.AuthenticationSteps
for token authentication.public VaultToken login()
ClientAuthentication
VaultToken
. This method can optionally log into Vault to obtain a
token
.login
in interface ClientAuthentication
VaultToken
.public AuthenticationSteps getAuthenticationSteps()
AuthenticationStepsFactory
AuthenticationSteps
describing an authentication flow.getAuthenticationSteps
in interface AuthenticationStepsFactory
AuthenticationSteps
describing an authentication flow.Copyright © 2016–2021 Pivotal Software, Inc.. All rights reserved.