J'essaie d'implémenter SSO sur plusieurs applications Web utilisant CAS et Spring Security. cas prévu:
CAS - http: // localhost: 8080/AR/
App Un contenu protégé - http: //localhost:8081/cas-client1/secure/index.html
App B contenu protégé - http: //localhost:8081/cas-client2/secure/index.html
Implémentation de l'authentification unique à l'aide de CAS + Spring Security
1) Lorsque l'utilisateur accède à cas-client1, le formulaire de connexion CAS est invité et déclenche l'authentification.
2) doit être reconnu, connexion précédente Le même accès utilisateur No CAS-client2 et aucune forme de connexion sera demandé
Cependant, je suis échoué à mettre en œuvre l'étape 2. formulaire de connexion de CAS toujours incité à l'utilisateur et nécessite donc deux s'identifier. Y at-il un mauvais réglage dans ma configuration Spring Security:
<security:http entry-point-ref="casAuthenticationEntryPoint" auto-config="true">
<security:intercept-url pattern="/secure/**" access="ROLE_USER" />
<security:custom-filter position="CAS_FILTER" ref="casAuthenticationFilter" />
</security:http>
<bean id="casAuthenticationEntryPoint" class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
<property name="loginUrl" value="http://localhost:8080/cas/login" />
<property name="serviceProperties" ref="serviceProperties" />
</bean>
<bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties">
<!-- http://localhost:8081/cas-client2 for app 2-->
<property name="service" value="http://localhost:8081/cas-client1/j_spring_cas_security_check" />
</bean>
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="casAuthenticationProvider" />
</security:authentication-manager>
<bean id="casAuthenticationFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter">
<property name="authenticationManager" ref="authenticationManager" />
<property name="authenticationFailureHandler">
<bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
<property name="defaultFailureUrl" value="/casfailed.jsp" />
</bean>
</property>
</bean>
<bean id="casAuthenticationProvider" class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<property name="userDetailsService" ref="userService" />
<property name="serviceProperties" ref="serviceProperties" />
<property name="ticketValidator">
<bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<constructor-arg index="0" value="http://localhost:8080/cas" />
</bean>
</property>
<property name="key" value="an_id_for_this_auth_provider_only" />
</bean>
<security:user-service id="userService">
<security:user name="wilson" password="wilson" authorities="ROLE_USER" />
</security:user-service>
bon de savoir pour les tests, mais je pense que tout le monde devrait être en cours d'exécution sur ce https- – chrismarx
Merci! Je suis tombé sur cette réponse pour la première fois il y a plus d'un an et j'ai recommencé à plonger dans CAS. Un autre paramètre qui peut poser problème dans les environnements QA est p: cookieDomain. Si le domaine diffère entre production et contrôle qualité, ce paramètre doit être entièrement ajusté ou supprimé. Suppression de p: cookieDomain et définition de p: cookieSecure = "false" est le paramètre le plus clément pour l'activation de CAS dans QA. – AndreiM
enfin je l'ai eu +1 .. – edaklij