Class GcpIamCredentialsAuthentication
java.lang.Object
org.springframework.vault.authentication.GcpJwtAuthenticationSupport
org.springframework.vault.authentication.GcpIamCredentialsAuthentication
- All Implemented Interfaces:
ClientAuthentication
public class GcpIamCredentialsAuthentication
extends GcpJwtAuthenticationSupport
implements ClientAuthentication
Google Cloud IAM credentials login implementation using GCP IAM service accounts to
legitimate its authenticity via JSON Web Token using the IAM Credentials
projects.serviceAccounts.signJwt
method.
This authentication method uses Googles IAM Credentials API to obtain a signed token
for a specific Credential
. Service account
details are obtained from a GoogleCredentials
that can be retrieved either from
a JSON file or the runtime environment (GAE, GCE).
GcpIamCredentialsAuthentication
uses Google Java API that uses synchronous API.- Since:
- 2.3.2
- Author:
- Andreas Gebauer, Mark Paluch
- See Also:
-
GcpIamCredentialsAuthenticationOptions
HttpTransport
GoogleCredentials
GoogleCredentials.getApplicationDefault()
RestOperations
- Auth Backend: gcp (IAM)
- GCP: projects.serviceAccounts.signJwt
-
Constructor Summary
ConstructorDescriptionGcpIamCredentialsAuthentication
(GcpIamCredentialsAuthenticationOptions options, RestOperations restOperations) Create a new instance ofGcpIamCredentialsAuthentication
givenGcpIamCredentialsAuthenticationOptions
andRestOperations
.GcpIamCredentialsAuthentication
(GcpIamCredentialsAuthenticationOptions options, RestOperations restOperations, com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider) Create a new instance ofGcpIamCredentialsAuthentication
givenGcpIamCredentialsAuthenticationOptions
,RestOperations
andTransportChannelProvider
. -
Method Summary
-
Constructor Details
-
GcpIamCredentialsAuthentication
public GcpIamCredentialsAuthentication(GcpIamCredentialsAuthenticationOptions options, RestOperations restOperations) Create a new instance ofGcpIamCredentialsAuthentication
givenGcpIamCredentialsAuthenticationOptions
andRestOperations
. This constructor initializesInstantiatingGrpcChannelProvider
for Google API usage.- Parameters:
options
- must not be null.restOperations
- HTTP client for Vault login, must not be null.
-
GcpIamCredentialsAuthentication
public GcpIamCredentialsAuthentication(GcpIamCredentialsAuthenticationOptions options, RestOperations restOperations, com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider) Create a new instance ofGcpIamCredentialsAuthentication
givenGcpIamCredentialsAuthenticationOptions
,RestOperations
andTransportChannelProvider
.- Parameters:
options
- must not be null.restOperations
- HTTP client for Vault login, must not be null.transportChannelProvider
- Provider for transport channel Google API use, must not be null.
-
-
Method Details
-
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
. - Throws:
VaultException
-
signJwt
-