Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Integrating CAS with Spring Security

 
Dan King
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to integrate CAS with Spring Security; however, I want to continue to use the custom login page I created for Spring Security or customize the CAS login page to look like the rest of the application. Is this possible? If yes, are they any documents, examples, etc. that show how to do this? Thanks.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan King wrote:I'd like to integrate CAS with Spring Security; however, I want to continue to use the custom login page I created for Spring Security or customize the CAS login page to look like the rest of the application. Is this possible? If yes, are they any documents, examples, etc. that show how to do this? Thanks.


What you want to look into is the UserDetailsService interface. This is the interface that Spring Security uses, calls to log someone in. There is one method
loadUserByUserName. If you want to you can implement your own and just have it call out to CAS to get the information it needs, Username, password and roles/authorities the user has. Put that information into a UserDetails object and return it from the method.

I believe though that there are already implementation of UserDetailsService for CAS, and if I recall correctly they are in the Spring Security jars.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic