Class LoginTokenAdapter
java.lang.Object
org.springframework.vault.authentication.LoginTokenAdapter
- All Implemented Interfaces:
ClientAuthentication
Adapts tokens created by a
ClientAuthentication to a
LoginToken. Allows decoration of a ClientAuthentication
object to perform a self-lookup after token retrieval to obtain the remaining
TTL, renewability, accessor and token type.
Using this adapter decrements the usage counter for the created token.
- Since:
- 1.1
- Author:
- Mark Paluch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLoginTokenAdapter(ClientAuthentication delegate, VaultClient client) LoginTokenAdapter(ClientAuthentication delegate, RestOperations restOperations) Deprecated. -
Method Summary
-
Constructor Details
-
LoginTokenAdapter
@Deprecated(since="4.1") public LoginTokenAdapter(ClientAuthentication delegate, RestOperations restOperations) Deprecated.since 4.1, useLoginTokenAdapter(ClientAuthentication, VaultClient)instead.- Parameters:
delegate- must not be null.restOperations- must not be null.
-
LoginTokenAdapter
- Parameters:
delegate- must not be null.client- must not be null.- Since:
- 4.1
-
-
Method Details
-
login
Description copied from interface:ClientAuthenticationObtain aVaultTokenfor authenticated Vault access.This method may perform an authentication request to Vault or return a cached or pre-configured token.
- Specified by:
loginin interfaceClientAuthentication- Returns:
- the Vault token for subsequent authenticated requests
- Throws:
VaultLoginException- if authentication fails.VaultException- See Also:
-
LoginTokenAdapter(ClientAuthentication, VaultClient)instead.