Package org.skyway.spring.util.webservice

Examples of org.skyway.spring.util.webservice.WebServiceInvocationCredentials


    return getUserPass(arg2);
  }

  private UserPass getUserPass(Message message) {
    if (Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
      WebServiceInvocationCredentials parameters = WebServiceInvocationCredentialsHolder.get();

      if (parameters != null && parameters.isAuthenticationBasic()) {
        return createUserPass(parameters.getUserId(), parameters.getPassword());
      }
    }

    return null;
  }
View Full Code Here


    /*
     * If we are the requestor, then this means we are making an external web service
     * call and need to check if we need to set credentials before the call is made.
     */
    if (Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
      WebServiceInvocationCredentials parameters = WebServiceInvocationCredentialsHolder.get();

      if (parameters != null && parameters.isAuthenticationWsSecurity()) {
        Map props = new HashMap();
        props.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
        props.put(WSHandlerConstants.USER, parameters.getUserId());
        props.put(WSHandlerConstants.PASSWORD_TYPE, parameters.isHashPassword() ? WSConstants.PW_DIGEST : WSConstants.PW_TEXT);
        props.put(WSHandlerConstants.PW_CALLBACK_REF, new ApplyCredentialsHandler());

        WSS4JOutInterceptor wss4jInHandler = new WSS4JOutInterceptor(props);

        message.getInterceptorChain().add(wss4jInHandler);
View Full Code Here

*
*/
public class ApplyCredentialsHandler implements CallbackHandler {

  public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
    WebServiceInvocationCredentials parameters = WebServiceInvocationCredentialsHolder.get();
    WSPasswordCallback passwordCallback = (WSPasswordCallback) callbacks[0];

    if (parameters != null && parameters.isAuthenticationWsSecurity()) {
      passwordCallback.setPassword(parameters.getPassword());
    }
  }
View Full Code Here

TOP

Related Classes of org.skyway.spring.util.webservice.WebServiceInvocationCredentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.