How do you integrate Spring Security with SiteMinder to receive a User and Role?
I have a project setup with Spring Security 'in-memory' and I want to use convert it to accept SiteMinder header with User and Roles. If SiteMinder will send the role of the user (ROLE_READ,ROLE_WRITE) and have the Service layer grant access. How do you convert the in-memory to use SiteMinder?
In-Memory User Roles
List of users and roles for in-memory
<authentication-manager>
<authentication-provider>
<user-service>
<user name="test" password="test" authorities="ROLE_READ" />
<user name="admin" password="admin" authorities="ROLE_READ,ROLE_WRITE" />
</user-service>
</authentication-provider>
</authentication-manager>
Service Layer Protection
Here the service methods are protected with specific roles
<beans:bean id="testService" class="com.stackoverflow.test" scope="request">
<security:intercept-methods>
<security:protect access="ROLE_WRITE" method="do*"/>
<security:protect access="ROLE_READ" method="find*"/>
</security:intercept-methods>
</beans:bean>
This source (Spring Security Java Config for Siteminder) looks promising but its always assigned role RoleEmployee.
There is Spring Security for SiteMinder that exists to receive a User only. However, to receive a Role you'll need to create an extended authentication process. This will authenticate a user using a role.
Within the
root-security.xml
SiteMinderUserDetailsService
SiteMinderUserDetails
SiteMinderFilter
AuthenticationImpl