Created
December 30, 2019 12:45
-
-
Save gnschenker/0e83f0f51df2d9933b25045bb5334144 to your computer and use it in GitHub Desktop.
Configuring Authentication via Bearer tokens
This file contains 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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddAuthentication(options => | |
{ | |
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; | |
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; | |
}).AddJwtBearer(options => | |
{ | |
options.Authority = $"https://{Configuration["Auth0:Domain"]}/"; | |
options.Audience = Configuration["Auth0:Audience"]; | |
}); | |
services.AddControllers(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment