Class KubernetesAuthentication
java.lang.Object
org.springframework.vault.authentication.KubernetesAuthentication
- All Implemented Interfaces:
AuthenticationStepsFactory,ClientAuthentication
public class KubernetesAuthentication
extends Object
implements ClientAuthentication, AuthenticationStepsFactory
Kubernetes implementation of
ClientAuthentication.
KubernetesAuthentication uses a Kubernetes Service Account JSON Web Token to
login into Vault. JWT and Role are sent in the login request to Vault to obtain a
VaultToken.- Since:
- 2.0
- Author:
- Michal Budzyn, Mark Paluch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionKubernetesAuthentication(KubernetesAuthenticationOptions options, RestOperations restOperations) -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationStepsCreates aAuthenticationStepsfor kubernetes authentication givenKubernetesAuthenticationOptions.Get theAuthenticationStepsdescribing an authentication flow.login()Return aVaultToken.
-
Constructor Details
-
KubernetesAuthentication
public KubernetesAuthentication(KubernetesAuthenticationOptions options, RestOperations restOperations) - Parameters:
options- must not be null.restOperations- must not be null.
-
-
Method Details
-
createAuthenticationSteps
public static AuthenticationSteps createAuthenticationSteps(KubernetesAuthenticationOptions options) Creates aAuthenticationStepsfor kubernetes authentication givenKubernetesAuthenticationOptions.- Parameters:
options- must not be null.- Returns:
AuthenticationStepsfor kubernetes 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.
-