Examples of SAMLParms


Examples of org.apache.ws.security.saml.ext.SAMLParms

        if (handler == null) {
            policyNotAsserted(token, "No SAML CallbackHandler available");
            return null;
        }
       
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(handler);
        if (token.isUseSamlVersion11Profile10() || token.isUseSamlVersion11Profile11()) {
            samlParms.setSAMLVersion(SAMLVersion.VERSION_11);
        } else if (token.isUseSamlVersion20Profile11()) {
            samlParms.setSAMLVersion(SAMLVersion.VERSION_20);
        }
        info.setAsserted(true);
        AssertionWrapper assertion = new AssertionWrapper(samlParms);
       
        boolean selfSignAssertion =
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

    @Override
    public void handleMessage(Message message) throws Fault {
       
        // Create a SAML Token
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(new SamlCallbackHandler());
        try {
            AssertionWrapper assertion = new AssertionWrapper(samlParms);
            Document doc = DOMUtils.createDocument();
            Element token = assertion.toDOM(doc);
            message.setContextualProperty(SAMLConstants.SAML_TOKEN_ELEMENT, token);
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

        String id = "1234";
        ep.getEndpointInfo().setProperty(TokenStore.class.getName(), new MemoryTokenStore());
        ep.getEndpointInfo().setProperty(SecurityConstants.TOKEN_ID, id);
        TokenStore store = (TokenStore)ep.getEndpointInfo().getProperty(TokenStore.class.getName());

        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(new Saml2CallbackHandler());
        AssertionWrapper assertion = new AssertionWrapper(samlParms);
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Element assertionElement = assertion.toDOM(db.newDocument());
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

    /**
     * Mock up a SAML Assertion by using another SAMLCallbackHandler
     * @throws Exception
     */
    private Element getSAMLAssertion(Document doc) throws Exception {
        SAMLParms parms = new SAMLParms();
        SamlCallbackHandler callbackHandler = new SamlCallbackHandler(saml2);
        parms.setCallbackHandler(callbackHandler);
        AssertionWrapper assertionWrapper = new AssertionWrapper(parms);

        return assertionWrapper.toDOM(doc);
    }
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

   
    public static AssertionWrapper createAssertion(Message message,
                                                   CallbackHandler handler,
                                                   boolean selfSignAssertion) throws Fault {
           
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(handler);
        try {
            AssertionWrapper assertion = new AssertionWrapper(samlParms);
            if (selfSignAssertion) {
                //--- This code will be moved to a common utility class
                Crypto crypto = new CryptoLoader().getCrypto(message,
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

    }
   
    public static AssertionWrapper createAssertion(CallbackHandler handler,
                                                   SelfSignInfo info) throws Fault {
           
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(handler);
        try {
            AssertionWrapper assertion = new AssertionWrapper(samlParms);
            assertion.signAssertion(info.getUser(),
                                    info.getPassword(),
                                    info.getCrypto(),
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

            samlRealm = realmMap.get(realm);
        }
       
        SamlCallbackHandler handler = createCallbackHandler(tokenParameters, secret, samlRealm, doc);
       
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(handler);
        AssertionWrapper assertion = new AssertionWrapper(samlParms);
       
        if (samlCustomHandler != null) {
            samlCustomHandler.handle(assertion, tokenParameters);
        }
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

            samlRealm = realmMap.get(realm);
        }
       
        SamlCallbackHandler handler = createCallbackHandler(tokenParameters, secret, samlRealm, doc);
       
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(handler);
        AssertionWrapper assertion = new AssertionWrapper(samlParms);
       
        if (signToken) {
            STSPropertiesMBean stsProperties = tokenParameters.getStsProperties();
           
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

        SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
        callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
        callbackHandler.setConfirmationMethod(SAML1Constants.CONF_SENDER_VOUCHES);
        callbackHandler.setIssuer("www.example.com");
       
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(callbackHandler);
        AssertionWrapper assertion = new AssertionWrapper(samlParms);
       
        WSSecSignatureSAML wsSign = new WSSecSignatureSAML();
        wsSign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
       
View Full Code Here

Examples of org.apache.ws.security.saml.ext.SAMLParms

    public void testSAML1AuthnAssertion() throws Exception {
        SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
        callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
        callbackHandler.setIssuer("www.example.com");
       
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(callbackHandler);
        AssertionWrapper assertion = new AssertionWrapper(samlParms);

        WSSecSAMLToken wsSign = new WSSecSAMLToken();

        Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
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.