简体   繁体   English

获取System.ArgumentNullException的Azure应用服务自定义身份验证:“值不能为空”“参数名称:提供者”

[英]Azure App Service custom authentication getting System.ArgumentNullException: “Value cannot be null” “Parameter name: provider”

I have a simple dot net mobile app with custom authentication following the example at ( https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-dotnet-backend-how-to-use-server-sdk#custom-auth ) 我有一个简单的点网移动应用程序,其自定义身份验证遵循以下示例( https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-dotnet-backend-how- to-use-server-sdk #custom-auth

I have an endpoint for generating the JWT Token https://test2ixresearcher.azurewebsites.net/.auth/login/custom?username=ade%40ixcompany.com&password=a (the user name and password are not checked, you can enter anything) 我有一个端点用于生成JWT令牌https://test2ixresearcher.azurewebsites.net/.auth/login/custom?username=ade%40ixcompany.com&password=a (未选中用户名和密码,您可以输入任何内容)

This creates a token which I use to call a secured endpoint with the provided token in the X-ZUMO-AUTH header: https://test2ixresearcher.azurewebsites.net/api/SecuredData - Calling the end point with an incorrect token or token missing returns a 401, as expected - Calling the end point with the token just created generates a 500 with the following message, no expected 这将创建一个令牌,用于在X-ZUMO-AUTH标头中使用提供的令牌调用安全端点: https ://test2ixresearcher.azurewebsites.net/api/SecuredData - 使用不正确的令牌或令牌丢失来调用端点按预期返回401 - 使用刚创建的令牌调用终点会生成500,其中包含以下消息,无预期

--Start Error message-- Application: 2018-09-22T23:12:20 PID[5520] Critical System.ArgumentNullException: Value cannot be null. --Start错误消息 - 应用程序:2018-09-22T23:12:20 PID [5520]严重System.ArgumentNullException:值不能为空。 Application: Parameter name: provider Application: at Microsoft.Azure.AppService.Authentication.EasyAuthTokenStore.d__7.MoveNext() Application: --- End of stack trace from previous location where exception was thrown --- 应用程序:参数名称:provider应用程序:at Microsoft.Azure.AppService.Authentication.EasyAuthTokenStore.d__7.MoveNext()应用程序:---从抛出异常的上一个位置开始的堆栈跟踪结束---

--End Error message-- I also have an unsecured endpoint and this works without any problems. --End错误消息 - 我也有一个不安全的端点,这没有任何问题。 https://test2ixresearcher.azurewebsites.net/api/UnSecuredData https://test2ixresearcher.azurewebsites.net/api/UnSecuredData

I have deployed at least 4 other apps with this model and this is the first instance of having this error. 我已经使用此模型部署了至少4个其他应用程序,这是第一个出现此错误的实例。 The error appears in the authentication, it seems to successfully validate the token issuer and pull out the user, and it fails before hitting my code. 该错误出现在身份验证中,它似乎成功验证了令牌颁发者并撤出了用户,并且在命中我的代码之前失败了。

My code can be found at https://github.com/antitheos/publictesting/tree/master/TestAzureCustomLogin 我的代码可以在https://github.com/antitheos/publictesting/tree/master/TestAzureCustomLogin找到

This is happening when published to azure in a new app service created through the portal or Visual Studio. 在通过门户网站或Visual Studio创建的新应用服务中发布到azure时会发生这种情况。 I have old app services working but I afraid to trying publishing to them in case i break live apps the are working. 我有旧的应用程序服务工作,但我害怕尝试发布给他们,以防我破坏正在运行的实时应用程序。

Any help would be appreciated. 任何帮助,将不胜感激。

Ok, Microsoft found the issue! 好的,微软发现了这个问题!

The product team found a regression bug and it's now slated for fixing in the next release for about a month from now. 产品团队发现了一个回归错误,现在它将在下一个版本中修复大约一个月。 In the meantime, you can resolve it with the following steps. 在此期间,您可以通过以下步骤解决它。

  1. Open Azure portal, navigate to your App Service 打开Azure门户,导航到您的App Service
  2. Click on Resource Explorer blade 单击Resource Explorer刀片
  3. Under your site node, expand the config node and then click authSettings. 在站点节点下,展开配置节点,然后单击authSettings。
  4. In the top pane, ensure you have read/write selected. 在顶部窗格中,确保已选择读/写。
  5. Click Edit button 单击编辑按钮
  6. Modify the runtimeVersion to = 0.0.0 将runtimeVersion修改为= 0.0.0
  7. Click Put 点击Put
  8. Click Post 点击发布
  9. Restart your website. 重启你的网站。

在此输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TwoCheckout System.ArgumentNullException:值不能为null参数名称:s - TwoCheckout System.ArgumentNullException : Value cannot be null Parameter name: s System.ArgumentNullException: '值不能为空。 参数名称:items' - System.ArgumentNullException: 'Value cannot be null. Parameter name: items' System.ArgumentNullException:值不能为null。 参数名称:ownerType - System.ArgumentNullException: Value cannot be null. Parameter name: ownerType System.ArgumentNullException:值不能为 null 参数名称:值 - 如何修复此错误? - System.ArgumentNullException: Value cannot be null Parameter name: value - How to fix this error? 异常:System.ArgumentNullException:值不能是 null - Exception: System.ArgumentNullException: Value cannot be null System.ArgumentNullException: '值不能是 null。 参数名称:实体'我在使用 POST 方法时收到此错误 - System.ArgumentNullException: 'Value cannot be null. Parameter name: entity' i get this error while using POST methode .Net BinaryFormater System.ArgumentNullException:对象图不能为null。 参数名称:图形 - .Net BinaryFormater System.ArgumentNullException: Object Graph cannot be null. Parameter name: graph System.ArgumentNullException:值不能为 null。 (参数“类型”)OData 单元测试升级到 .NET 6.0 - System.ArgumentNullException : Value cannot be null. (Parameter 'type') OData Unit Test upgrade to .NET 6.0 .Net Core Migration System.ArgumentNullException:值不能为null - .Net Core Migration System.ArgumentNullException: Value cannot be null Net7 C# Kestrel UseHttps() throws System.ArgumentNullException:Value cannot be null. (Parameter 'provider') 在尝试启用 QUIC/Http3 时 - Net7 C# Kestrel UseHttps() throws System.ArgumentNullException:Value cannot be null. (Parameter 'provider') when attempting to enable QUIC/Http3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM