Hi All,
Finally i am able to fetch the User Attributes of the Logged in User from 
the CAS Server to the client.

Thanks all for the help.

The below mentioned changes i did as suggested by you guys.

1. Used  Cas30ServiceTicketValidator instead of Cas20ServiceTicketValidator
2.  Corrected the attribute name in AuthenticationUserDetailsService

   @Bean
    public AuthenticationUserDetailsService 
authenticationUserDetailsService(){
        String[] role ={"user_role"};
        return new 
GrantedAuthorityFromAssertionAttributesUserDetailsService(role);
    }

"user_role" name was not matching the column name in the Users table in CAS 
server database.

3. Configured the Database attribute repository on the CAS Server side as i 
was storing the user details in Database.

cas.authn.attributeRepository.jdbc.singleRow=true
cas.authn.attributeRepository.jdbc.requireAllAttributes=true
cas.authn.attributeRepository.jdbc.caseCanonicalization=NONE
cas.authn.attributeRepository.jdbc.queryType=OR

cas.authn.attributeRepository.jdbc.sql=SELECT * FROM users  WHERE {0}
cas.authn.attributeRepository.jdbc.username=username
#cas.authn.attributeRepository.jdbc.user_role=user_role
cas.authn.attributeRepository.jdbc.healthQuery=SELECT 1
cas.authn.attributeRepository.jdbc.isolateInternalQueries=false
cas.authn.attributeRepository.jdbc.url=jdbc:postgresql://localhost:5432/casdb
cas.authn.attributeRepository.jdbc.failFast=true
cas.authn.attributeRepository.jdbc.isolationLevelName=ISOLATION_READ_COMMITTED
cas.authn.attributeRepository.jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect
cas.authn.attributeRepository.jdbc.leakThreshold=10
cas.authn.attributeRepository.jdbc.propagationBehaviorName=PROPAGATION_REQUIRED
cas.authn.attributeRepository.jdbc.batchSize=1
cas.authn.attributeRepository.jdbc.user=postgres
cas.authn.attributeRepository.jdbc.ddlAuto=update
cas.authn.attributeRepository.jdbc.password=postgres
cas.authn.attributeRepository.jdbc.autocommit=false
cas.authn.attributeRepository.jdbc.driverClass=org.postgresql.Driver
cas.authn.attributeRepository.jdbc.idleTimeout=5000
cas.authn.attributeRepository.jdbc.pool.suspension=false
cas.authn.attributeRepository.jdbc.pool.minSize=6
cas.authn.attributeRepository.jdbc.pool.maxSize=18
cas.authn.attributeRepository.jdbc.pool.maxIdleTime=1000
cas.authn.attributeRepository.jdbc.pool.maxWait=2000



After these changes i was able to fetch the user attributes from CAS Server.

Cheers!

-- 
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/2eeab0b6-a514-4b5b-941b-7d269a7f826e%40apereo.org.

Reply via email to