【问题标题】:The data protection operation was unsuccessful数据保护操作不成功
【发布时间】:2016-03-19 12:28:40
【问题描述】:

我正在尝试将来自 Kentor AuthServices 的示例 MVC 应用程序部署到 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>

如果我可以提供任何进一步的信息来帮助您帮助我,请告诉我!

【问题讨论】:

    标签: okta kentor-authservices


    【解决方案1】:

    这实际上是一个 Azure 问题 as Anders points out。解决方法是将以下内容添加到 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>
    

    【讨论】:

      【解决方案2】:

      看起来像是 Kentor.AuthServices 中的一个错误。我最近做了一些使用数据保护 API 的重写,所以那里可能有问题。请在github site 提交问题,并包含异常的堆栈跟踪以及有关您正在使用的 API 模块(MVC、HttpModule 或 OWIN)的信息。

      【讨论】:

      • 好的,谢谢安德斯。我提出了一个问题 (github.com/KentorIT/authservices/issues/427)。如果是错误,我稍后会删除此帖子。
      • @steve 最好把这个留在这里,让其他人看看他们是否遇到同样的问题。
      猜你喜欢
      • 1970-01-01
      • 2013-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多