@Override protected void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callback) throws IOException, UnsupportedCallbackException { UserDetails user = loadUserDetails(callback.getPrincipal().getName()); WSUsernameTokenPrincipalImpl principal = callback.getPrincipal(); UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(principal, principal.getPassword(), user.getAuthorities()); if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authRequest.toString()); } SecurityContextHolder.getContext().setAuthentication(authRequest); }
private void processPrincipal(WSHandlerResult result) { List<WSSecurityEngineResult> results = result.getActionResults().get(WSConstants.UT); if (!CollectionUtils.isEmpty(results)) { WSSecurityEngineResult actionResult = results.get(0); Principal principal = (Principal) actionResult.get(WSSecurityEngineResult.TAG_PRINCIPAL); if (principal != null && principal instanceof WSUsernameTokenPrincipalImpl) { WSUsernameTokenPrincipalImpl usernameTokenPrincipal = (WSUsernameTokenPrincipalImpl) principal; UsernameTokenPrincipalCallback callback = new UsernameTokenPrincipalCallback(usernameTokenPrincipal); try { validationCallbackHandler.handle(new Callback[]{callback}); } catch (IOException ex) { logger.warn("Principal callback resulted in IOException", ex); } catch (UnsupportedCallbackException ex) { // ignore } } } }
private void processPrincipal(WSHandlerResult result) { List<WSSecurityEngineResult> results = result.getActionResults().get(WSConstants.UT); if (!CollectionUtils.isEmpty(results)) { WSSecurityEngineResult actionResult = results.get(0); Principal principal = (Principal) actionResult.get(WSSecurityEngineResult.TAG_PRINCIPAL); if (principal != null && principal instanceof WSUsernameTokenPrincipalImpl) { WSUsernameTokenPrincipalImpl usernameTokenPrincipal = (WSUsernameTokenPrincipalImpl) principal; UsernameTokenPrincipalCallback callback = new UsernameTokenPrincipalCallback(usernameTokenPrincipal); try { validationCallbackHandler.handle(new Callback[]{callback}); } catch (IOException ex) { logger.warn("Principal callback resulted in IOException", ex); } catch (UnsupportedCallbackException ex) { // ignore } } } }
@Override protected void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callback) throws IOException, UnsupportedCallbackException { UserDetails user = loadUserDetails(callback.getPrincipal().getName()); WSUsernameTokenPrincipalImpl principal = callback.getPrincipal(); UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(principal, principal.getPassword(), user.getAuthorities()); if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authRequest.toString()); } SecurityContextHolder.getContext().setAuthentication(authRequest); }
private void processPrincipal(WSHandlerResult result) { List<WSSecurityEngineResult> results = result.getActionResults().get(WSConstants.UT); if (!CollectionUtils.isEmpty(results)) { WSSecurityEngineResult actionResult = results.get(0); Principal principal = (Principal) actionResult.get(WSSecurityEngineResult.TAG_PRINCIPAL); if (principal != null && principal instanceof WSUsernameTokenPrincipalImpl) { WSUsernameTokenPrincipalImpl usernameTokenPrincipal = (WSUsernameTokenPrincipalImpl) principal; UsernameTokenPrincipalCallback callback = new UsernameTokenPrincipalCallback(usernameTokenPrincipal); try { validationCallbackHandler.handle(new Callback[]{callback}); } catch (IOException ex) { logger.warn("Principal callback resulted in IOException", ex); } catch (UnsupportedCallbackException ex) { // ignore } } } }
@Override protected void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callback) throws IOException, UnsupportedCallbackException { UserDetails user = loadUserDetails(callback.getPrincipal().getName()); WSUsernameTokenPrincipalImpl principal = callback.getPrincipal(); UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(principal, principal.getPassword(), user.getAuthorities()); if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authRequest.toString()); } SecurityContextHolder.getContext().setAuthentication(authRequest); }