Sto cercando di implementare SSO su diverse applicazioni Web utilizzando CAS e Spring Security. caso previsto:
CAS - http: // localhost: 8080/CAS/
App Un contenuto protetto - http: //localhost:8081/cas-client1/secure/index.html
App B contenuto protetto - http: //localhost:8081/cas-client2/secure/index.html
Implementare SSO utilizzando CAS + Spring Security
1) Quando l'utente accede a cas-client1, verrà richiesto il modulo di accesso CAS e verrà attivata l'autenticazione.
2) L'accesso dello stesso utente cas-CLIENT2 precedente login dovrebbe essere riconosciuto e nessuna forma di accesso verrà richiesto
Tuttavia, sono riuscito a implementare il passaggio 2. CAS form di login ancora richiesto di utente e quindi richiede il doppio accesso. C'è qualche impostazione sbagliata nella mia configurazione Primavera di sicurezza:
<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>
bene sapere per il test, ma credo che tutti dovrebbero essere in esecuzione su questo https- – chrismarx
Grazie! Ho scoperto per la prima volta questa risposta più di un anno fa e ho iniziato a immergermi nuovamente in CAS. Un altro parametro che può essere problematico negli ambienti QA è p: cookieDomain. Se il dominio differisce tra produzione e controllo qualità, è necessario modificare o rimuovere completamente questa impostazione. Rimozione di p: cookieDomain e impostazione p: cookieSecure = "false" è l'impostazione più indulgente per l'attivazione e il funzionamento di CAS in QA. – AndreiM
finalmente ho ottenuto +1 .. – edaklij