2016-07-29 54 views
0

SSOCircleとデフォルトのキーストアでSpring SAMLサンプルプロジェクトを試しています。 SPメタデータをSSOCircleにインポートした後、SSOが正しく機能しました。は、SHA-1からRSA SHA-256に暗号化アルゴリズムを変更しました。ここに示されているよう は、だから私はSAMLBootstrapクラスを拡張:またここにSpring SAMLサンプル:SSOCircle SHA256がサポートされていません

public final class CustomSAMLBootstrap extends SAMLBootstrap { 

    @Override 
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { 
     super.postProcessBeanFactory(beanFactory); 
     BasicSecurityConfiguration config = (BasicSecurityConfiguration) Configuration.getGlobalSecurityConfiguration(); 
     config.registerSignatureAlgorithmURI("RSA", SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256); 
     config.setSignatureReferenceDigestMethod(SignatureConstants.ALGO_ID_DIGEST_SHA256); 
    } 

は、拡張メタデータの設定が

<!-- Extended metadata properties --> 
<bean id="extendedMetadataSP" class="org.springframework.security.saml.metadata.ExtendedMetadata"> 
    <property name="local" value="true"/> 
    <property name="securityProfile" value="metaiop"/> 
    <property name="sslSecurityProfile" value="pkix"/> 
    <property name="signingKey" value="apollo"/> 
    <property name="encryptionKey" value="apollo"/> 
    <property name="signMetadata" value="true" /> 
    <property name="signingAlgorithm" value="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /> 
    <property name="idpDiscoveryEnabled" value="true"/> 
    <property name="idpDiscoveryURL" value="${entityBaseURL}/saml/discovery"/> 
    <property name="idpDiscoveryResponseURL" value="${entityBaseURL}/saml/login?disco=true"/> 

</bean> 

ですだから私はorg.springframework.security.saml.metadata.MetadataGenerator豆を経由してメタデータを再生成し、再アップロード新たに生成してみましたSP xml。 SSOCircleは007エラーコードで失敗します。

enter image description here

この時点で私はSSOCircleにSHA256を使用するために私のために完了するための追加ステップがあるかどうかわかりませんか?

誰かが助けてくれますか?

EDIT:

<?xml version="1.0"?> 
<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="#urn_com_apakgroup_bristol"> 
     <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>mAT5iN6IWyTCQiPplFmOq4vu8SUzCBfpAC4XBOu2+eM=</ds:DigestValue> 
    </ds:Reference> 
</ds:SignedInfo> 
<ds:SignatureValue>i6hH............bA==</ds:SignatureValue> 
<ds:KeyInfo> 
    <ds:X509Data> 
     <ds:X509Certificate>MIIDZTCCA............eVdvh</ds:X509Certificate> 
    </ds:X509Data> 
</ds:KeyInfo> 
</ds:Signature> 
:私はSSOCircleにメタデータをアップロードするとき、私はそれが署名algorithは、以下のようにSHA256として指定されているEntityDescriptorセクションに関係していると信じていたのです

問題

signMetadataをfalseに変更しましたが、残念ながら違いはありません。

<property name="signMetadata" value="false" /> 

SAML応答:

2016-09-13 15:03:06,786 DEBUG org.opensaml.xml.security.SigningUtil:115 - Computing signature over input using private key of type RSA and JCA algorithm ID SHA256withRSA 
2016-09-13 15:03:06,802 DEBUG org.opensaml.xml.security.SigningUtil:123 - Computed signature: 8b4...dfa9 
2016-09-13 15:03:06,802 DEBUG opensaml.saml2.binding.encoding.HTTPRedirectDeflateEncoder:251 - Generated digital signature value (base64-encoded) i0...== 
2016-09-13 15:03:06,803 DEBUG PROTOCOL_MESSAGE:74 - 
<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" AssertionConsumerServiceURL="http://localhost:8080/saml/SSO" Destination="https://idp.ssocircle.com:443/sso/SSORedirect/metaAlias/publicidp" ForceAuthn="false" ID="ac8eeg2j9d932hh4fe90fa71844e00" IsPassive="false" IssueInstant="2016-09-13T14:03:06.775Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0"> 
    <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">...[my-sp]...</saml2:Issuer> 
</saml2p:AuthnRequest> 

2016-09-13 15:03:06,803 DEBUG opensaml.ws.message.encoder.BaseMessageEncoder:56 - Successfully encoded message. 
2016-09-13 15:03:06,804 DEBUG springframework.security.saml.storage.HttpSessionStorage:93 - Storing message ac8eeg2j9d932hh4fe90fa71844e00 to session C17D8A94DED2F79BDD92CBF7A99462C6 
2016-09-13 15:03:06,805 INFO springframework.security.saml.log.SAMLDefaultLogger:127 - AuthNRequest;SUCCESS;0:0:0:0:0:0:0:1;...[my-sp]...;https://idp.ssocircle.com;;; 
+0

エラーと前述のデバッグトレースにつながるサンプルリクエストを提供してください。 – Hos

+0

私はSHA256でキーストアを作成しました。あなたは他の場所で問題を抱えているかもしれません。 – Alic

答えて

0

error7理由は、メタデータの署名が検証できないことです。 how-to section「署名されたメタデータによって検証の問題が発生する可能性があります。最速の回避策として署名を削除することをおすすめします。」

あなたは、メタデータ署名が有効になっている:

<property name="signMetadata" value="true" /> 

ターンそれを "false"。

+0

こんにちは私はそれを偽に変えましたが、何の違いもありませんでした。とにかく助けてくれてありがとう – nuvio

+0

もし気にしないなら、ここにメタデータを投稿してください。 – Hos

関連する問題