Examples of SamlCallbackHandler


Examples of org.apache.cxf.systest.ws.saml.client.SamlCallbackHandler

        QName portQName = new QName(NAMESPACE, "DoubleItSaml2EndorsingTransportPort");
        DoubleItPortType saml2Port =
                service.getPort(portQName, DoubleItPortType.class);
        updateAddressPort(saml2Port, PORT2);
       
        SamlCallbackHandler callbackHandler = new SamlCallbackHandler();
        callbackHandler.setConfirmationMethod(SAML2Constants.CONF_HOLDER_KEY);
        callbackHandler.setKeyInfoIdentifier(CERT_IDENTIFIER.KEY_VALUE);
        ((BindingProvider)saml2Port).getRequestContext().put(
            "ws-security.saml-callback-handler", callbackHandler
        );

        int result = saml2Port.doubleIt(25);
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

            if (principal instanceof WSUsernameTokenPrincipal) {
              SAMLNameIdentifier nameId = null;
              if(config.getCallbackHander() != null){
                SAMLNameIdentifierCallback cb = new SAMLNameIdentifierCallback(data);
                cb.setUserId(principal.getName());
                SAMLCallbackHandler callbackHandler = config.getCallbackHander();
                callbackHandler.handle(cb);
                nameId = cb.getNameId();
              }else{
                  nameId = new SAMLNameIdentifier(
                principal.getName(), null, SAMLNameIdentifier.FORMAT_EMAIL);
              }
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

          
            SAMLAttribute[] attrs = null;
            if(config.getCallbackHander() != null){
              SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
              SAMLCallbackHandler handler = config.getCallbackHander();
              handler.handle(cb);
              attrs = cb.getAttributes();
            }else{
              //TODO Remove this after discussing
                SAMLAttribute attribute = new SAMLAttribute("Name",
                        "https://rahas.apache.org/saml/attrns", null, -1, Arrays
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

            if (principal instanceof WSUsernameTokenPrincipal) {
              SAMLNameIdentifier nameId = null;
              if(config.getCallbackHander() != null){
                SAMLNameIdentifierCallback cb = new SAMLNameIdentifierCallback(data);
                cb.setUserId(principal.getName());
                SAMLCallbackHandler callbackHandler = config.getCallbackHander();
                callbackHandler.handle(cb);
                nameId = cb.getNameId();
              }else{
                  nameId = new SAMLNameIdentifier(
                principal.getName(), null, SAMLNameIdentifier.FORMAT_EMAIL);
              }
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

          
            SAMLAttribute[] attrs = null;
            if(config.getCallbackHander() != null){
              SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
              SAMLCallbackHandler handler = config.getCallbackHander();
              handler.handle(cb);
              attrs = cb.getAttributes();
            }else{
              //TODO Remove this after discussing
                SAMLAttribute attribute = new SAMLAttribute("Name",
                        "https://rahas.apache.org/saml/attrns", null, -1, Arrays
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

        Attribute[] attributes = null;

        //Call the attribute callback handlers to get any attributes if exists
        if (config.getCallbackHandler() != null) {
            SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
            SAMLCallbackHandler handler = config.getCallbackHandler();
            handler.handle(cb);
            attributes = cb.getSAML2Attributes();
        }
        else if (config.getCallbackHandlerName() != null
                && config.getCallbackHandlerName().trim().length() > 0) {
            SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
            SAMLCallbackHandler handler = null;
            MessageContext msgContext = data.getInMessageContext();
            ClassLoader classLoader = msgContext.getAxisService().getClassLoader();
            Class cbClass = null;
            try {
                cbClass = Loader.loadClass(classLoader, config.getCallbackHandlerName());
            } catch (ClassNotFoundException e) {
                throw new TrustException("cannotLoadPWCBClass", new String[]{config
                        .getCallbackHandlerName()}, e);
            }
            try {
                handler = (SAMLCallbackHandler) cbClass.newInstance();
            } catch (java.lang.Exception e) {
                throw new TrustException("cannotCreatePWCBInstance", new String[]{config
                        .getCallbackHandlerName()}, e);
            }
            handler.handle(cb);
            attributes = cb.getSAML2Attributes();
            // else add the attribute with a default value
        }

        //else add the attribute with a default value
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

            if (principal instanceof WSUsernameTokenPrincipal) {
              SAMLNameIdentifier nameId = null;
              if(config.getCallbackHandler() != null){
                SAMLNameIdentifierCallback cb = new SAMLNameIdentifierCallback(data);
                cb.setUserId(principal.getName());
                SAMLCallbackHandler callbackHandler = config.getCallbackHandler();
                callbackHandler.handle(cb);
                nameId = cb.getNameId();
              }else{
                  nameId = new SAMLNameIdentifier(
                principal.getName(), null, SAMLNameIdentifier.FORMAT_EMAIL);
              }
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

          
            SAMLAttribute[] attrs = null;
            if(config.getCallbackHandler() != null){
              SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
              SAMLCallbackHandler handler = config.getCallbackHandler();
              handler.handle(cb);
              attrs = cb.getAttributes();
            } else if (config.getCallbackHandlerName() != null
          && config.getCallbackHandlerName().trim().length() > 0) {
        SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
        SAMLCallbackHandler handler = null;
        MessageContext msgContext = data.getInMessageContext();
        ClassLoader classLoader = msgContext.getAxisService().getClassLoader();
        Class cbClass = null;
        try {
          cbClass = Loader.loadClass(classLoader, config.getCallbackHandlerName());
        } catch (ClassNotFoundException e) {
          throw new TrustException("cannotLoadPWCBClass", new String[]{config
              .getCallbackHandlerName()}, e);
        }
        try {
          handler = (SAMLCallbackHandler) cbClass.newInstance();
        } catch (java.lang.Exception e) {
          throw new TrustException("cannotCreatePWCBInstance", new String[]{config
              .getCallbackHandlerName()}, e);
        }
        handler.handle(cb);
        attrs = cb.getAttributes();
            }else{
              //TODO Remove this after discussing
                SAMLAttribute attribute = new SAMLAttribute("Name",
                        "https://rahas.apache.org/saml/attrns", null, -1, Arrays
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

            throws TrustException {
        try {
            SAMLAttribute[] attrs = null;
            if (config.getCallbackHandler() != null) {
                SAMLAttributeCallback cb = new SAMLAttributeCallback(rahasData);
                SAMLCallbackHandler handler = config.getCallbackHandler();
                handler.handle(cb);
                attrs = cb.getAttributes();
            } else if (config.getCallbackHandlerName() != null
                       && config.getCallbackHandlerName().trim().length() > 0) {
                SAMLAttributeCallback cb = new SAMLAttributeCallback(rahasData);
                SAMLCallbackHandler handler = null;
                MessageContext msgContext = rahasData.getInMessageContext();
                ClassLoader classLoader = msgContext.getAxisService().getClassLoader();
                Class cbClass = null;
                try {
                    cbClass = Loader.loadClass(classLoader, config.getCallbackHandlerName());
                } catch (ClassNotFoundException e) {
                    throw new TrustException("cannotLoadPWCBClass",
                                             new String[]{config.getCallbackHandlerName()}, e);
                }
                try {
                    handler = (SAMLCallbackHandler) cbClass.newInstance();
                } catch (Exception e) {
                    throw new TrustException("cannotCreatePWCBInstance",
                                             new String[]{config.getCallbackHandlerName()}, e);
                }
                handler.handle(cb);
                attrs = cb.getAttributes();
            } else {
                //TODO Remove this after discussing
                SAMLAttribute attribute = new SAMLAttribute("Name",
                                                            "https://rahas.apache.org/saml/attrns",
View Full Code Here

Examples of org.apache.rahas.impl.util.SAMLCallbackHandler

    Attribute[] attributes = null;

    // Call the attribute callback handlers to get any attributes if exists
    if (config.getCallbackHander() != null) {
      SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
      SAMLCallbackHandler handler = config.getCallbackHander();
      handler.handle(cb);
      attributes = cb.getSAML2Attributes();
    } else if (config.getCallbackHandlerName() != null
        && config.getCallbackHandlerName().trim().length() > 0) {
      SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
      SAMLCallbackHandler handler = null;
      MessageContext msgContext = data.getInMessageContext();
      ClassLoader classLoader = msgContext.getAxisService().getClassLoader();
      Class cbClass = null;
      try {
        cbClass = Loader.loadClass(classLoader, config.getCallbackHandlerName());
      } catch (ClassNotFoundException e) {
        throw new TrustException("cannotLoadPWCBClass", new String[]{config
            .getCallbackHandlerName()}, e);
      }
      try {
        handler = (SAMLCallbackHandler) cbClass.newInstance();
      } catch (java.lang.Exception e) {
        throw new TrustException("cannotCreatePWCBInstance", new String[]{config
            .getCallbackHandlerName()}, e);
      }
      handler.handle(cb);
      attributes = cb.getSAML2Attributes();
      // else add the attribute with a default value
    } else {
      SAMLObjectBuilder<Attribute> attrBuilder = (SAMLObjectBuilder<Attribute>) builderFactory
          .getBuilder(Attribute.DEFAULT_ELEMENT_NAME);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.