public final class Auth
extends java.lang.Object
The implementing class for operations on Vault's /v1/auth/* REST endpoints.
This class is not intended to be constructed directly. Rather, it is meant to used by way of Vault
in a DSL-style builder pattern. See the Javadoc comments of each public method for usage examples.
| Constructor and Description |
|---|
Auth(VaultConfig config) |
| Modifier and Type | Method and Description |
|---|---|
AuthResponse |
loginByAppID(java.lang.String path,
java.lang.String appId,
java.lang.String userId)
Basic login operation to authenticate to an app-id backend.
|
AuthResponse |
loginByUsernamePassword(java.lang.String path,
java.lang.String password)
Basic login operation to authenticate to a Username & Password backend.
|
public Auth(VaultConfig config)
public AuthResponse loginByAppID(java.lang.String path, java.lang.String appId, java.lang.String userId) throws VaultException
Basic login operation to authenticate to an app-id backend. Example usage:
final AuthResponse response = vault.auth().loginByAppID("app-id/login", "app_id", "user_id"); final String token = response.getAuthClientToken());
path - The path on which the authentication is performed (e.g. auth/app-id/login)appId - The app-id used for authenticationuserId - The user-id used for authenticationVaultExceptionpublic AuthResponse loginByUsernamePassword(java.lang.String path, java.lang.String password) throws VaultException
Basic login operation to authenticate to a Username & Password backend. Example usage:
final AuthResponse response = vault.auth().loginByUsernamePassword("userpass/login/test", "password"); final String token = response.getAuthClientToken());
path - The path on which the authentication is performed (e.g. auth/userpass/login/username)password - The password used for authenticationVaultException