Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

498
Vistas
Error The 'ClientId' option must be provided. When building a docker image

I've started a new .net core project and I configured it to use the Google+ Api for authentication. My Client Id and Secret are stored using dotnet user-secrets. When I build my docker image I get

 Unhandled Exception: System.ArgumentException: The 'ClientId' option must be provided.

I know this is because my secrets aren't being provided to the image. What I want to know is how can I provide my Id and Secret key without committing them to the repository and still run my image locally.

I was thinking when I deploy it to the server I can have them as part of the Env variables, I guess I could do that locally too, just wondering if anyone else has a solution for this that may be more elegant than mine.

I just can't find much info on how others are doing this.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

To Add Google+ Authentication you can see this guide.

Add this snippet in startup.cs

services.AddAuthentication().AddGoogle(googleOptions =>
{
    googleOptions.ClientId = Configuration["Authentication:Google:ClientId"];
    googleOptions.ClientSecret = Configuration["Authentication:Google:ClientSecret"];
});

Add this line in appsettings.json

"Authentication": {
    "Google": {
        "ClientId": "ID FROM GOOGLE API",
        "ClientSecret": "SECRET FROM GOOGLE API"
}
over 4 years ago · Santiago Trujillo Denunciar

0

First of all, secrets is not what you should use for deploying. Secrets exists for safe storage during development by helping prevent sensitive data from being storing in code / checked into source control. See related question How do UserSecrets work in the Cloud?

And you are right, that you should use Environment Variables for instead, or as alternative, some external settings storage like DB.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda