2015-10-01 2 views
0

J'ai implémenté Spring SAML SSO dans une application Web JEE6 sur Wildfly 8.2 pour l'authentification avec ADFS2/3, mais pour le moment, je ne parviens pas à obtenir de succès dans le processus d'autorisation. Voici ce la demande/réponse ping/pong:Boucle entre l'application ADFS et Spring-SAML

<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" 
       AssertionConsumerServiceURL="https://172.19.100.141:8443/saml/SSO" 
       Destination="MYIDP" 
       ForceAuthn="false" 
       ID="a1be1ie43303d6ei1fa8je1fdd1jhh4" 
       IsPassive="false" 
       IssueInstant="2015-10-05T16:52:54.680Z" 
       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">SPENTITY</saml2:Issuer> 

Réponse:

<samlp:Response ID="_c644ea1a-88e9-4022-a9fc-52071d0e67bc" 
      Version="2.0" 
      IssueInstant="2015-10-05T16:52:54.658Z" 
      Destination="https://172.19.100.141:8443/saml/SSO" 
      Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" 
      InResponseTo="a1be1ie43303d6ei1fa8je1fdd1jhh4" 
      xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
      > 
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">IDP/adfs/services/trust</Issuer> 
<samlp:Status> 
    <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" /> 
</samlp:Status> 
<EncryptedAssertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion"> 
    <xenc:EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" 
         xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" 
         > 
     <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" /> 
     <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> 
      <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#"> 
       <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"> 
        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
       </e:EncryptionMethod> 
       <KeyInfo> 
        <ds:X509Data xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 
         <ds:X509IssuerSerial> 
          <ds:X509IssuerName>MY ISSUER RDATA</ds:X509IssuerName> 
          <ds:X509SerialNumber>686142642</ds:X509SerialNumber> 
         </ds:X509IssuerSerial> 
        </ds:X509Data> 
       </KeyInfo> 
       <e:CipherData> 
        <e:CipherValue>VAL</e:CipherValue> 
       </e:CipherData> 
      </e:EncryptedKey> 
     </KeyInfo> 
     <xenc:CipherData> 
      <xenc:CipherValue>VAL</xenc:CipherValue> 
     </xenc:CipherData> 
    </xenc:EncryptedData> 
</EncryptedAssertion> 

Quand j'atteins plus de 6 demande dans les deux dernières minutes, gouttes ADFS la connexion et je reçois une erreur. Quelle est l'erreur possible? J'ai ajouté toutes les clés nécessaires à mon keystore, pourquoi le client continue-t-il à demander même si le champ de la réponse du code d'état a été un succès?

Répondre

1

Le problème a été useReferer propriété setted à true pour SavedRequestAwareAuthenticationSuccessHandler

<!-- Handler deciding where to redirect user after successful login --> 
<beans:bean id="successRedirectHandler" class="org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler"> 
<!-- <beans:property name="useReferer" value="true"/> --> 
    <beans:property name="defaultTargetUrl" value="/dispatcher"/> 
</beans:bean>