首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Azure函数V2 JWT - AD身份验证

Azure函数V2 JWT - AD身份验证
EN

Stack Overflow用户
提问于 2019-06-05 23:49:01
回答 1查看 1.8K关注 0票数 3

我正在尝试验证Azure Functions v2。我正在进入error Microsoft.AspNetCore.Authentication.Core: No authentication handler is registered for the scheme 'WebJobsAuthLevel'. The registered schemes are: Bearer. Did you forget to call AddAuthentication().Add[SomeAuthHandler]("WebJobsAuthLevel",...)?.下方

下面是我在Startup.cs中使用的代码

代码语言:javascript
复制
    public class Startup : IWebJobsStartup
    {
        public void Configure(IWebJobsBuilder builder)
        {
            builder.Services.AddAuthentication()
                    .AddJwtBearer(JwtBearerDefaults.AuthenticationScheme,o =>
                    {
                        o.Audience = "https://*******************.azurewebsites.net/";
                        o.Authority = "http://localhost:****";
                        o.RequireHttpsMetadata = false;
                        o.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
                        {
                            RequireSignedTokens = true,
                            ValidAudience = "https://***************.azurewebsites.net/",
                            ValidateAudience = true,
                            ValidIssuer = "https://sts.windows.net/***************-5********2**/",
                            ValidateIssuer = true,
                            ValidateIssuerSigningKey = true,
                            ValidateLifetime = true
                        };
                    });
        }

    }

更改了代码,但仍收到相同的给定错误。我漏掉了哪一个?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56463935

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档