0

Webサイトでの認証にWIFSSOを使用しています。開発環境ではすべてが完璧に機能します。しかし、展開時に問題が発生しました

メッセージ:データ保護操作は失敗しました。これは、現在のスレッドのユーザーコンテキストに対してユーザープロファイルがロードされていないことが原因である可能性があります。これは、スレッドが偽装している場合に発生する可能性があります。ExceptionStackTrace:System.Security.Cryptography.ProtectedData.Protect(Byte [] userData、Byte []optionalEntropy、DataProtectionScopeスコープ)at Microsoft.IdentityModel.Web.ProtectedDataCookieTransform.Encode(Byte [] value)

この問題を検索すると、このスタックオーバーフローの質問につながります 。LoadUserProfile= TrueなしでWIFを実行することは可能ですか? 上記のコードを追加しましたが、現在は

値をnullにすることはできません

e.ServiceConfiguration.ServiceCertificateServiceCertificatenullを取得しています。私の質問は、これはどのような種類の証明書であり、構成のどこでこれを定義できるかということです。ACSに同じ証明書を配置する必要がありますか?

これが私の設定セクションです

<microsoft.identityModel>
    <service>
      <audienceUris>
        <add value="http://localhost:9494/" />
      </audienceUris>      
      <federatedAuthentication>
        <wsFederation passiveRedirectEnabled="true" issuer="https://devworks-sb.accesscontrol.appfabriclabs.com/v2/wsfederation" realm="http://localhost:9494" requireHttps="false" />
        <cookieHandler requireSsl="false" />
      </federatedAuthentication>
      <applicationService>
        <claimTypeRequired>
          <!--Following are the claims offered by STS 'https://devworks-sb.accesscontrol.appfabriclabs.com/'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
          <claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
          <claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" optional="true" />-->
          <!--<claimType type="http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider" optional="true" />-->
        </claimTypeRequired>
      </applicationService>
      <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <trustedIssuers>
          <add thumbprint="BE9D0A516BEC2BC820C23D5C2EA79F068C094382" name="https://devworks-sb.accesscontrol.appfabriclabs.com/" />
        </trustedIssuers>
      </issuerNameRegistry>      
    </service>   </microsoft.identityModel>

ありがとう

4

2 に答える 2

2

展開後に問題が発生したと最初に言ったのですが、そうですか?web.configで、audienceUrisをhttp://whatever_service_name.cloudapp.netに変更しましたか?

<audienceUris>
    <add value="http://localhost:9494/" /> <== This is  wrong
 </audienceUris>  

次に、e.ServiceConfiguration.ServiceCertificateで証明書に関する質問がNULLです。次のことを確認してください。

A.エンドポイントがアプリケーションのサービス定義に追加されます。

B.証明書の拇印はサービス構成で設定されます

C.証明書は上記の正しいweb.configに設定されています

D.最後に、web.configに以下を追加して、証明書を指紋で検索できるようにします。

<serviceCertificate>
   <certificateReference x509FindType="FindByThumbprint" findValue="CERT_THUMB" />
</serviceCertificate>

非常に役立つ次の2つのリソースを調べてください。

http://www.jimandkatrin.com/CodeBlog/post/Troubleshooting-Azure-issues.aspx

http://blogs.msmvps.com/marcelmeijer/blog/2012/05/04/windows-azure-wif-access-control-acs/

于 2012-05-27T05:47:26.967 に答える
1

根本的な原因は、DPAPI(WIFのデフォルト構成)を使用している可能性があります。アプリケーションがWindowsAzureで動作するように、いくつかの変更を試してください。チュートリアルについては、http://msdn.microsoft.com/en-us/IdentityTrainingCourse_WIFonWAZLab2010を確認することをお勧めします。

よろしくお願いします、

明徐。

于 2012-05-22T07:42:20.517 に答える