2017-06-15 4 views
3

認証にADFSを使用するようにIdentityServerを設定しようとしています。流れは次のようになります。IdentityServerとADFS

ユーザー - >カスタムアプリ - > IS - > ADFS

私はほとんどすべての設定をしましたが、私はISとADFSの間の通信にこだわっています。ユーザーはADFSで正常にログインしているようだが、私はエラーを取得:

ID4037:私は戻って取得するときに署名を検証するために必要なキーは次のセキュリティキー識別子「SecurityKeyIdentifier

から解決することができませんでしたISに。

トークン署名証明書に問題があることは明らかです。私はいくつかの異なる証明書間の関係を説明するドキュメントを見つけるのに失敗した。

今はトークンに署名する(SignatureCertificateプロパティIdentityServerOptionsを使用してセットアップする)自己署名入りの証明書を持っており、AD証明書にトークンに署名するようにAD証明書が設定されています。

適切に行うためのガイドや推奨事項はありますか?それは両方で同じでなければならないのですか、それとも動作させるために何か他のものを設定する必要がありますか?フィドラーで

EDIT 私は、ADFS内のすべてがうまく実行され、結果がIdentityServerに掲載されているときにエラーがあることがわかります。 wresultのPARAMに投稿されたXMLは次のとおりです。

<t:RequestSecurityTokenResponse xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust"> 
    <t:Lifetime> 
    <wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-06-20T12:25:31.148Z</wsu:Created> 
    <wsu:Expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-06-20T13:25:31.148Z</wsu:Expires> 
    </t:Lifetime> 
    <wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"> 
    <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing"> 
     <wsa:Address>urn:identityServer</wsa:Address> 
    </wsa:EndpointReference> 
    </wsp:AppliesTo> 
    <t:RequestedSecurityToken> 
    <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="_fd1a14cd-4d18-407b-97d4-9f9dfcacd29a" Issuer="http://ssosrv.mydomain.com/adfs/services/trust" IssueInstant="2017-06-20T12:25:31.148Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"> 
     <saml:Conditions NotBefore="2017-06-20T12:25:31.148Z" NotOnOrAfter="2017-06-20T13:25:31.148Z"> 
     <saml:AudienceRestrictionCondition> 
      <saml:Audience>urn:identityServer</saml:Audience> 
     </saml:AudienceRestrictionCondition> 
     </saml:Conditions> 
     <saml:AttributeStatement> 
     <saml:Subject> 
      <saml:NameIdentifier>[email protected]</saml:NameIdentifier> 
      <saml:SubjectConfirmation> 
      <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod> 
      </saml:SubjectConfirmation> 
     </saml:Subject> 
     <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims"> 
      <saml:AttributeValue>[email protected]</saml:AttributeValue> 
     </saml:Attribute> 
     <saml:Attribute AttributeName="name" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims"> 
      <saml:AttributeValue>Name Surname</saml:AttributeValue> 
     </saml:Attribute> 
     <saml:Attribute AttributeName="upn" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims"> 
      <saml:AttributeValue>[email protected]</saml:AttributeValue> 
     </saml:Attribute> 
     </saml:AttributeStatement> 
     <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" AuthenticationInstant="2017-06-20T12:25:31.039Z"> 
     <saml:Subject> 
      <saml:NameIdentifier>[email protected]</saml:NameIdentifier> 
      <saml:SubjectConfirmation> 
      <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod> 
      </saml:SubjectConfirmation> 
     </saml:Subject> 
     </saml:AuthenticationStatement> 
     <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 
     <ds:SignedInfo> 
      <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> 
      <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /> 
      <ds:Reference URI="#_fd1a14cd-4d18-407b-97d4-9f9dfcacd29a"> 
      <ds:Transforms> 
       <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /> 
       <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> 
      </ds:Transforms> 
      <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> 
      <ds:DigestValue>6CeXXXXXXXXXXXXXXXXXXXX=</ds:DigestValue> 
      </ds:Reference> 
     </ds:SignedInfo> 
     <ds:SignatureValue>q9hJBFFFFFFFFFFFFFFFFFFFF==</ds:SignatureValue> 
     <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> 
      <X509Data> 
      <X509Certificate>MIIFnzXXXXXXXXXXXXXXXXXXXX</X509Certificate> 
      </X509Data> 
     </KeyInfo> 
     </ds:Signature> 
    </saml:Assertion> 
    </t:RequestedSecurityToken> 
    <t:TokenType>urn:oasis:names:tc:SAML:1.0:assertion</t:TokenType> 
    <t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType> 
    <t:KeyType>http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey</t:KeyType> 
</t:RequestSecurityTokenResponse> 

メモリから、 アルバート

答えて

5

解決しました。 ADFSの統合とは関係がありませんでしたが、Identity Serverでのフェデレーション認証のセットアップ方法はどのようになっていましたか。私は2つのフェデレーション認証アイデンティティプロバイダを使用していました。これは、ADFSとWinAuthを使用したものです。コールバックがなければ、ADFSからの応答はWinAuthによって処理されていたので、それぞれのコールバックを設定して動作しています。

2

ありがとう:

  • あなたはフォーマットを.CERするIS証明書を変換する必要があります。
  • mmcでは、証明書と「すべてのタスク」/「エクスポート」を右クリックします。
  • 「エクスポートウィザード」をクリックして選択: 「いいえ、秘密鍵をエクスポートしない」 "DERでエンコードされたバイナリX.509(.CER)"。
  • エクスポートするファイル名を選択して[保存]します。
  • オプションを確認し、[完了]をクリックします。
  • ADFSウィザードで.cerファイルを[証明書]タブにインポートします。
+0

ADFSとISで同じ証明書を使用するように変更しましたが、まだエラーが発生しています。いずれにしても、具体的な解決策よりもドキュメント/ガイドラインが必要ですが、理由はわかりません。 – Albert

+0

このページの下部をご覧ください:https://social.technet.microsoft.com/wiki/contents/articles/1420ad-fs-2-0-id4037-the-key-following-security-key-identifier.aspxから解決できなかった署名を検証する必要があります。失効チェックを無効にする – stombeur

+0

@stombeur私はそれを試みましたが、同じエラーが発生しています... – Albert