Created
June 22, 2012 17:52
-
-
Save Kallin/2974211 to your computer and use it in GitHub Desktop.
SamlAuthenticationFilter.groovy
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
class SamlAuthenticationFilter extends AbstractAuthenticationProcessingFilter { | |
public SamlAuthenticationFilter() { | |
super("/somecustomauth") | |
} | |
@Override | |
Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) { | |
if (!request.getMethod().equals("POST")) { | |
throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod()) | |
} | |
String accessToken = request.getParameter("sometoken") | |
return this.getAuthenticationManager().authenticate(new SamlAuthenticationToken(accessToken)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment