Skip to content

Instantly share code, notes, and snippets.

@jesuscampos
Created May 12, 2018 19:58
Show Gist options
  • Save jesuscampos/843811de719b5d9ec6956331258656c4 to your computer and use it in GitHub Desktop.
Save jesuscampos/843811de719b5d9ec6956331258656c4 to your computer and use it in GitHub Desktop.
Configuración identity server básica
// AddMvcCore devuelve un objeto IMvcCoreBuilder que permite usar una
// interfaz fluida para configurar Mvc
services.AddMvcCore()
.AddAuthorization()
.AddJsonFormatters();
// El método AddIdentityServerAuthentication acepta un parámetro Action
// donde especificamos una expresión lambda que usa propiedades
// expuestas en el objeto options
services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options =>
{
options.Authority = "http://localhost:5000";
options.RequireHttpsMetadata = false;
options.ApiName = "api1";
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment