我正在尝试将示例MVC应用程序从Kentor AuthServices部署到Azure并使用Okta作为IDP。我已经跳过了一些障碍,但偶然发现了CryptographicException"数据保护操作不成功"。我不确定如何解决它。
发生这种情况时,浏览器中的 URL https://mysite.azurewebsites.net/AuthServices/Acs
任何帮助不胜感激,谢谢。
下面是我的web.config的kentor部分。我没有身份服务器,因此删除了所有联合配置。
<kentor.authServices entityId="https://mysite.azurewebsites.net/AuthServices"
returnUrl="https://mysite.azurewebsites.net/"
authenticateRequestSigningBehavior="Never">
<identityProviders>
<add entityId="http://www.okta.com/1111111"
allowUnsolicitedAuthnResponse="true" binding="HttpRedirect"
metadataLocation="https://dev-11111.oktapreview.com/app/1111111/sso/saml/metadata"
loadMetadata="true">
<signingCertificate fileName="~/App_Data/okta.cert" />
</add>
</identityProviders>
如果我可以提供任何进一步的信息来帮助您协助我,请告诉我!
正如Anders指出的那样,这实际上是一个Azure问题。解决方法是将以下内容添加到 web.config:
<system.identityModel>
<identityConfiguration>
<securityTokenHandlers>
<add type="System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove type="System.IdentityModel.Tokens.SessionSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</securityTokenHandlers>
</identityConfiguration>
</system.identityModel>
看起来像Kentor.AuthServices中的一个错误。我最近做了一些重写,利用数据保护API,所以那里可能有问题。请在 github 站点提交问题,并包括异常的堆栈跟踪以及有关您正在使用的 API 模块(MVC、HttpModule 或 OWIN)的信息。