0
我想在线上使用Auth0来保护我的web webAPI netcoreapp 2.0,所以我做了所有the steps。向我的API发送授权承载accessToken时出现错误500 Auth0
我有一个401,当我不发送授权,没关系。
我有一个200的时候,我不把[授权]
我有一个500的时候,我把Authorization头与承载+的accessToken(复制从API上Auth0网站上的令牌)
有没有人有这个问题?
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
}).AddJwtBearer(options =>
{
options.Authority = "https://******.eu.auth0.com/";
options.Audience = "https://**************.azurewebsites.net/";
});
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseAuthentication();
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
});
app.UseDeveloperExceptionPage();
app.UseStaticFiles();
app.UseMvcWithDefaultRoute();
}
核心1.1或2.0?,在哪里/你如何生成令牌? –
嗨,这是一个netcoreapp 2.0 我在非交互式客户端页面上生成带有Auth0的令牌。 –