I've successfully integrate JOSSO and Spring Security applications to my Grails application (using LDAP for user control).
Since JOSSO already manages authentication, I'm using "Pre-Authentication Scenarios" for Spring Security integration. Here is my resources.groovy
content related to Spring Security configuration:
def developmentEnvironment = {
if (grailsApplication.config.grails.plugins.springsecurity.active) {
preAuthenticatedAuthenticationProvider(PreAuthenticatedAuthenticationProvider) {
preAuthenticatedUserDetailsService = ref('preAuthenticatedUserDetailsService')
}
preAuthenticatedUserDetailsService(PreAuthenticatedGrantedAuthoritiesUserDetailsService) {
}
j2eePreAuthFilter(J2eePreAuthenticatedProcessingFilter) {
authenticationManager = ref('authenticationManager')
authenticationDetailsSource = {
J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource authenticationDetailsSource ->
mappableRolesRetriever = {
SimpleMappableAttributesRetriever mappableAttributesRetriever ->
mappableAttributes = ['app_admin', 'app_user', 'app_report', 'app_access'] as Set
}
userRoles2GrantedAuthoritiesMapper = {
SimpleAttributes2GrantedAuthoritiesMapper grantedAuthoritiesMapper ->
convertAttributeToUpperCase = "true"
}
}
}
preAuthenticatedProcessingFilterEntryPoint(Http403ForbiddenEntryPoint) {
}
preAuthenticatedExceptionTranslationFilter(ExceptionTranslationFilter) {
authenticationEntryPoint = ref('preAuthenticatedProcessingFilterEntryPoint')
}
}
}
Everything works fine and I can access default properties on Grails side (for example using springSecurityService
).
But now I have a new requirement to get custom properties from LDAP (for example ownership
). So, I add these properties to my user under LDAP, as far as I know JOSSO automatically will get these properties, but I can't get these on grails application side.
Is there any way to get these properties on grails side?