Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
- if (!request.post) {
- throw new AuthenticationServiceException("not supported: $request.method")
- }
- String username = (obtainUsername(request) ?: '').trim()
- String password = (obtainPassword(request) ?: '').trim()
- String extrafield1 = request.getParameter("extrafield1")
- String extrafield2 = request.getParameter("extrafield2")
- def authentication = new CustomAuthToken(username, password, extrafield1, null, false, false, false)
- HttpSession session = request.getSession(false)
- if (session || getAllowSessionCreation()) {
- request.session['SPRING_SECURITY_LAST_USERNAME_KEY'] = TextEscapeUtils.escapeEntities(username)
- }
- return getAuthenticationManager().authenticate(authentication)
- }
- CustomAuthToken(Object principal, Object credentials, String extrafield1, String PVM, Boolean isAccept, Boolean isLogEnabled, Boolean is3PLEnabled) {
- super(principal, credentials)
- extra1 = extrafield1
- }
- CustomAuthToken(Object principal, Object credentials, String extrafield1, String extrafield2, String PVM, Boolean isAccept, Boolean isLogEnabled, Boolean is3PLEnabled) {
- super(principal, credentials)
- extra1 = extrafield1
- extra2 = extrafield2
- }
Add Comment
Please, Sign In to add comment