@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); }
@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); }
@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); }
/** * Invoked when the callback has a {@link WSPasswordCallback#USERNAME_TOKEN} usage. * * <p>This method is invoked when WSS4J needs the password to fill in or to verify a UsernameToken. * * <p>Default implementation throws an {@link UnsupportedCallbackException}. */ protected void handleUsernameToken(WSPasswordCallback callback) throws IOException, UnsupportedCallbackException { UserDetails user = loadUserDetails(callback.getIdentifier()); if (user != null) { SpringSecurityUtils.checkUserValidity(user); callback.setPassword(user.getPassword()); } }
/** * Invoked when the callback has a {@link WSPasswordCallback#USERNAME_TOKEN} usage. * * <p>This method is invoked when WSS4J needs the password to fill in or to verify a UsernameToken. * * <p>Default implementation throws an {@link UnsupportedCallbackException}. */ protected void handleUsernameToken(WSPasswordCallback callback) throws IOException, UnsupportedCallbackException { UserDetails user = loadUserDetails(callback.getIdentifier()); if (user != null) { SpringSecurityUtils.checkUserValidity(user); callback.setPassword(user.getPassword()); } }
/** * Invoked when the callback has a {@link WSPasswordCallback#USERNAME_TOKEN} usage. * * <p>This method is invoked when WSS4J needs the password to fill in or to verify a UsernameToken. * * <p>Default implementation throws an {@link UnsupportedCallbackException}. */ protected void handleUsernameToken(WSPasswordCallback callback) throws IOException, UnsupportedCallbackException { UserDetails user = loadUserDetails(callback.getIdentifier()); if (user != null) { SpringSecurityUtils.checkUserValidity(user); callback.setPassword(user.getPassword()); } }