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
package com.example.test.util | |
import org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter | |
class MockRequestHeaderAuthenticationFilter extends RequestHeaderAuthenticationFilter { | |
String mockPrincipal | |
@Override | |
protected Object getPreAuthenticatedPrincipal(javax.servlet.http.HttpServletRequest request) { |
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
environments { | |
development { | |
SpringSecurityUtils.clientRegisterFilter('mockTestFilter', SecurityFilterPosition.PRE_AUTH_FILTER.order + 10) | |
} | |
test { | |
SpringSecurityUtils.clientRegisterFilter('mockTestFilter', SecurityFilterPosition.PRE_AUTH_FILTER.order + 10) | |
} | |
qa { | |
SpringSecurityUtils.clientRegisterFilter('shibAuthFilter', SecurityFilterPosition.PRE_AUTH_FILTER.order + 10) | |
} |
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) { |
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
package sample; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.security.MessageDigest; | |
import java.security.SecureRandom; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; |