-
Notifications
You must be signed in to change notification settings - Fork 863
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
Using SSO in .NET Core with Docker Compose #3438
Comments
We received a similar report with the error message you're seeing a couple of years ago (#2477). The root cause was the SDK was not handling the However, that should be fixed in the latest version (I just tried it with a sample console app and it succeeded - although I used a standalone And yes, when deploying to EKS the SDK will use the container credential provider - fetching credentials from the environment and not the shared configuration file. |
HI @dscpinheiro , this is what I'm currently running:
The NuGet packages I have direct references to are:
I am building my Docker image to run as non-root, and my Docker file looks like this:
I have tried running without the Is there any other information that I can give that might help? |
I've created a simple solution to illustrate the problem : https://github.com/davidkeaveny/aws-sso-docker If I set the
If I replace those environment variables with |
Hi @davidkeaveny, sorry for the delay in the response but I believe I found out why you were running into that problem. The SDK caches a few values when authenticating with SSO in the If I update the
Can you try it and let us know if that works for you too? And as I mentioned in other reply, when you deploy your application to EKS you won't need to set these environment variables manually, the service will handle that for you. |
Thanks @dscpinheiro your solution works for me! There isn't a huge amount of documentation around using SSO with Docker Compose - is this nugget of information worth capturing somewhere? |
Probably, as you said our documentation could be better. If you have specific suggestions, please leave feedback on our developer guide page about SSO (https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/sso.html) and our docs team will review it. |
Comments on closed issues are hard for our team to see. |
Does anyone have a good example of how to get a .NET 8 application running locally in Docker Compose if I am using SSO? All the examples I have seen at the moment assume you want to put your secrets into
appsettings.json
, which is not really a good practice. I'm using the current SDK libraries:My application code looks something like this:
and my Docker Compose file is:
If I then sign in to AWS SSO and then launch the app in Docker Compose:
then my app will report the following:
If I browse the running container, I can see the
.aws
file has mounted successfully, and I can see its contents.If I am going to be running this in EKS once I deploy to an actual environment rather than running locally, I want it to use the role associated with the deployment; that part seems to work okay.
Any idea how I can resolve this issue?
The text was updated successfully, but these errors were encountered: