Created
May 12, 2018 19:58
-
-
Save jesuscampos/843811de719b5d9ec6956331258656c4 to your computer and use it in GitHub Desktop.
Configuración identity server básica
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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