Azure Functions OpenID Connect预览安装程序内部服务器错误

问题描述

我按照此处的说明进行操作:

发现此博客文章非常有用:

要设置open id connect,以便我的azure函数可以与我的auth0配置集成在一起,包括将要使用的配置文件支持用于azure函数身份验证模块的设置。

我的auth.json文件如下:

{
    "platform": {
        "enabled": true
    },"globalValidation": {
        "requireAuthentication": true,"redirectToProvider": "auth0","unauthenticatedClientAction": "RedirectToLoginPage"
    },"identityProviders": {
        "openIdConnectProviders": {
            "auth0": {
                "enabled": true,"registration": {
                    "clientId": "******************","clientCredential": {
                        "secretSettingName": "AUTH0_CLIENT_SECRET"
                    },"openIdConnectConfiguration": {
                        "wellKNownopenIdConfiguration": "https://*********.auth0.com/.well-kNown/openid-configuration"
                    }
                },"login": {
                    "nameClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name","scope": ["openid","profile","email"],"loginParameters": []
                }
            }
        }
    },"login": {
        "tokenStore": {
            "enabled": true
        }
    }
}

它可以正确部署,并且所有文件都已正确更新,并带有正确的配置文件道具。但是,触发功能(httptrigger)后,我收到500内部服务器错误。在浏览了一些日志之后,我偶然发现了以下内容

2020-09-02T18:23:53  PID[5492] Critical    System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Azure.AppService.Middleware.OpenIdConnectProvider.GetLoginRedirectUrlAsync(HttpContextBase context,String callbackUrl,String postLoginRedirectUrl,NameValueCollection oauthState,String nonce)
   at Microsoft.Azure.AppService.Middleware.IdentityProviderBase.<RedirectToLoginPageAsync>d__40.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Azure.AppService.Middleware.EasyAuthModule.<AuthenticateAsync>d__49.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.AppService.Middleware.EasyAuthModule.<OnAuthenticateRequestAsync>d__31.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.AppService.Middleware.HttpModuledispatcher.<dispatchAsync>d__11.MoveNext()
2020-09-02T18:23:53  PID[5492] information Sending response: 500.79 Internal Server Error

任何想法将不胜感激!我知道它只是处于预览状态,但如果可能的话,我仍然想使用它。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)