Created
May 15, 2018 19:01
-
-
Save CESARDELATORRE/6a9200a32156414f65f2977825b07831 to your computer and use it in GitHub Desktop.
AddJwtBearer-ConfigureServices.cs
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
// prevent from mapping "sub" claim to nameidentifier. | |
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); | |
var identityUrl = Configuration.GetValue<string>("IdentityUrl"); | |
services.AddAuthentication(options => | |
{ | |
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; | |
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; | |
}).AddJwtBearer(options => | |
{ | |
options.Authority = identityUrl; | |
options.RequireHttpsMetadata = false; | |
options.Audience = "basket"; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment