0

I was looking through the questions between CAS and Spring Security, but I have not found the exact situation for this. My question is in regards with Setting up Spring Security to have it's users based off CAS.

Currently, we are modifying CAS to access the users itself, however, the app is guarded by Spring Security. As of now, CAS - Spring Security seems to delegate that we make our own custom UserService to get the users, but what If the users are from CAS itself?

Is there a way to recognize that when CAS finds the credentials valid, then Spring Security will also agree with it and do nothing? Or is that not how it should work?

What are your suggestions to remedy this problem?

KSGB
  • 1
  • 3
  • 1
    are you using the cas client? CasAuthenticationEntryPoint? do you want spring security to authenticate against cas? CasAuthenticationProvider has a authenticationUserDetailsService property where you can use an implementation of AuthenticationUserDetailsService to create a user based on the cas username and attributes – marco.eig Sep 11 '12 at 07:53
  • Yes. the aim is for Spring Security to authenticate against CAS. from what I saw, Spring Security seems to want to get from it's own user store and not acknowledge that CAS already let the user in. – KSGB Sep 19 '12 at 08:02

1 Answers1

0

You don't mention the Spring Security version you're using, so i'll just drop in a link to the latest from the 3.1 chain. Spring Security CAS Authentication

The CAS specification only requires a token exchange. The business of tracking the authenticated user is part of Spring Security. The relevant steps in the referenced documentation are 14 and 15. Spring Security defines the flow to have the AuthenticationProvider delegate to the UserDetailsService to create the objects that can be referenced throughout the application. You must define a UserDetailsService and have it construct a basic UserDetails object, even if that object is only pulling the user name from the CAS authentication principal.

Jason
  • 886
  • 8
  • 11