-
Notifications
You must be signed in to change notification settings - Fork 270
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
feat: support sts
type in profile provider
#642
Conversation
The credentials profile is static, but the STS token is dynamic. It need to refresh before expiration time automatic. So I think support a dynamic sts token in static configuration file is not a good idea. |
Actually, If we don't consider the temporary token refresh problem, we can pass the STS with environment variables. It's more lightweight. |
So, our use-case is that we use role-based OIDC SSO when doing local development. We use a bespoke tool for that, similar to https://github.com/aliyun/saml2alibabacloud. The tool persists the Some more background:
|
I am supporting the OIDC credentials provider, see #634 . Could you wait a moment to use the new credentials provider? |
Hi @maros7 , Two things:
// read oidc token from env ALIBABA_CLOUD_OIDC_TOKEN_FILE
// read oidc provider arn from env ALIBABA_CLOUD_OIDC_PROVIDER_ARN
// read role arn from env ALIBABA_CLOUD_ROLE_ARN
provider, err := credentials.NewOIDCCredentialsProviderBuilder().Build()
if err != nil {
panic(err)
}
client, err := sdk.NewClientWithOptions("cn-shanghai", config, provider)
if err != nil {
panic(err)
}
I recommend you to use the credentials-go. |
Fixes #641.