-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for using PropertiesFileCredentialsProvider in vault IAM authentication #245
Comments
Spring Cloud Vault configures authentication as Spring bean. You can configure and provide your own Providing an own authentication requires you to follow these two steps:
|
Thank you @mp911de for the quick response and suggesting me to define spring configuration. I have done some code reading for spring vault and slightly modified your code to achieve my task. With the code I tried, seeing below error: expected IAM user "some user-name" to resolve to unique AWS ID "xxxxx" but got "yyyyy" instead `
` During login, below headerJson is used with header names and authorization: Am I missing any required headers or something? Any help would be highly appreciated. |
Everything fine in your code.
looks like hashicorp/vault#2979 and not a Spring Vault/Spring Cloud Vault. Make sure to use a recent Vault version as the mentioned issue was fixed with 0.8.0. |
Thank you for the quick reply. We use Vault version 0.9.5. |
In that case, it might be good to file an issue in Vault and report your scenario there. There's nothing we can do from our side. |
I have aws credentials stored in a property file which has to be used for vault IAM authentication. I have planned to use com.amazonaws.auth.PropertiesFileCredentialsProvider to read from the properties file and use them for aws authentications. I was able to use this for S3 connectivity. For vault IAM authentication using spring-cloud-vault, I couldn't succeed.
Upon the code reading, I see that only DefaultAWSCredentialsProviderChain is being used for aws credentials lookup (https://github.com/spring-cloud/spring-cloud-vault/blob/v2.0.1.RELEASE/spring-cloud-vault-config/src/main/java/org/springframework/cloud/vault/config/ClientAuthenticationFactory.java#L291). Due to the usage of DefaultAWSCredentialsProviderChain, the credentials providers are restricted to only these four: EnvironmentVariableCredentialsProvider, SystemPropertiesCredentialsProvider, ProfileCredentialsProvider, EC2ContainerCredentialsProvider.
Can you please make AwsCredentialProvider configurable for spring-cloud vault authentication so that vault authentication can use the credentials from else where?
If there is already any way to achieve this, can you please provide me the details?
The text was updated successfully, but these errors were encountered: