Asp.net Core 2.1 Key Secrets in aws

Asked

Viewed 31 times

0

I need to store secret keys in aws so I can run my application, but I don’t know where I store these secret keys, and as I call them in my application, in my local application everything works perfectly but when I go up to aws I get the following error:

Argumentexception: The 'Clientid' option must be provided.

Example:

{
  "Authentication:Google:ClientId": "valor",
  "Authentication:Google:ClientSecret": "valor",

  "Authentication:Facebook:AppId": "valor",
  "Authentication:Facebook:AppSecret": "valor"
}

I want to store these values, so that my authentication by google and facebook can work too, in my online application.

  • Add more details, where you are storing the above information and where you are getting the error

  • @Leandroangelo that’s the problem, I don’t know where to store in aws. Locally I can compile and use because I store in Manager User Secrets, I get the error in aws simply by clicking on the project url

  • take a look at this article https://medium.com/@jonvines/using-aws-Secrets-manager-with-dotnet-core-a44b54bba8d4

  • To use AWS Secrets Manager you will need to encode and use the AWS SDK. or you can put these settings in the AWS environment variables that ASP.NET Core already makes the change automatically. Which service you are using to host?

  • I created by Elastic Beanstalk, so I put these variables as an environment variable, and I take them in my program ?

  • This: Configuration["Authentication:Google:Clientid"] in the program class you need to call Addenvironmentvariables() after Createdefaultbuilder and within Configureappconfiguration. If it doesn’t work with ":" in the various environment, try with "__" two underscore, but in Configuration it is always ":", ok?

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.