Last active
December 18, 2015 04:08
Grails spring bean setup for shib auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beans = { | |
userDetailsServiceWrapper(org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper) { | |
userDetailsService = ref('userDetailsService') | |
} | |
preauthAuthenticationProvider(org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider) { | |
preAuthenticatedUserDetailsService = ref('userDetailsServiceWrapper') | |
} | |
shibAuthFilter(org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter) { | |
principalRequestHeader = 'eppn' //this is the shib header that contains the user ID | |
checkForPrincipalChanges = true | |
invalidateSessionOnPrincipalChange = true | |
continueFilterChainOnUnsuccessfulAuthentication = false | |
authenticationManager = ref('authenticationManager') | |
} | |
//needed for mock authentication on local dev tier | |
mockTestFilter(com.example.test.util.MockRequestHeaderAuthenticationFilter) { | |
mockPrincipal = 'test' //Change this if you want to log in as a different user | |
checkForPrincipalChanges = true | |
invalidateSessionOnPrincipalChange = true | |
continueFilterChainOnUnsuccessfulAuthentication = false | |
authenticationManager = ref('authenticationManager') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment