-
Notifications
You must be signed in to change notification settings - Fork 249
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
SSO credential providers #4
Comments
Can we clarify the scope of this issue? For example, does this include SAML ( |
@abatkin - This is tracking the addition of a credential provider that retrieves temporary credentials using an SSO access token, similar to what's in the Go v2 SDK. You should already be able to make a call to |
Perfect. For anyone else who comes across this and wonders the same thing, see also #144 |
In the meantime, I've written a credential provider you can use until it comes to the sdk. |
Would also love to see this implemented! |
I created naftulikay/aws-sso-env as a stopgap solution for obtaining SSO credentials. You'll need to install Rust to compile it, follow the instructions in the repo to get things working. The general idea is that you will export credentials into your environment variables and have the AWS SDK for Rust just grab them from there, rather than using an integrated SSO provider in your code. I don't have the time right now to flesh this out into a full credentials provider, but perhaps in the future, I will. Thanks to @bobbyrward above for his code, I forked it locally and got the inspiration to build a standalone utility for doing this. |
this has landed in main and will go out in the next release! Thanks for the upvotes everyone 🎉 |
you can try this today by using the aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
# note that you'll need to switch services as well so that `aws_types::Config` is the same type from Rust's perspective:
aws-sdk-SERVICE = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" } |
landed in v0.5.2 |
|
@rcoh documentation on this seems pretty sparse. Would you be able to provide an example of how this works? I can see that there is a sso credentials provider here but I have no idea how to use it. Specifically, I would like to just specify the sso profile to use similar to boto3:
|
@vfilter The documentation is definitely lacking. What you're looking for, I believe, is something like (docs here): use aws_config::profile::{ProfileFileCredentialsProvider, ProfileFileRegionProvider};
use aws_config::profile::profile_file::{ProfileFiles, ProfileFileKind};
let sdk_config = aws_config::from_env()
.profile_name("sandbox")
.load()
.await; As for boto3, I'd recommend against modifying the default session with |
It would be nice if there were a documentation section under the AWS Rust SDK docs ➡️ https://docs.aws.amazon.com/sdk-for-rust/latest/dg/credentials.html It shows how to use static credentials, but that isn't a security best practice. |
Community Note
Tell us about your request
Add support for SSO credential providers
The text was updated successfully, but these errors were encountered: