Package org.opensaml

Examples of org.opensaml.SAMLAssertion.toDOM()


        saml.setInstanceDoc(doc);
        Crypto hokCrypto = CryptoFactory.getInstance("crypto.properties");
        saml.setUserCrypto(hokCrypto);
        saml.setUsername("16c73ab6-b892-458f-abf5-2f875f74882e");
        SAMLAssertion assertion = saml.newAssertion();
        Node assertionNode = assertion.toDOM(doc);
       
        WSSecHeader secHeader = new WSSecHeader();
        secHeader.insertSecurityHeader(doc);
        secHeader.getSecurityHeader().appendChild(assertionNode);
       
View Full Code Here


        //Create the RequestedSecurityToken element and add the SAML token to it
        OMElement reqSecTokenElem = TrustUtil
                .createRequestedSecurityTokenElement(wstVersion, rstrElem);
        Token assertionToken;
        try {
            Node tempNode = assertion.toDOM();
            reqSecTokenElem.
                    addChild((OMNode) ((Element) rstrElem).getOwnerDocument().importNode(tempNode,
                                                                                         true));

            // Store the token
View Full Code Here

                    addChild((OMNode) ((Element) rstrElem).getOwnerDocument().importNode(tempNode,
                                                                                         true));

            // Store the token
            assertionToken = new Token(assertion.getId(),
                                       (OMElement) assertion.toDOM(),
                                       creationTime,
                                       expirationTime);

            // At this point we definitely have the secret
            // Otherwise it should fail with an exception earlier
View Full Code Here

                SAMLKeyInfo samlKi = SAMLUtil.getSAMLKeyInfo(assertion,
                        signatureCrypto, tokenCallbackHandler);
                try {
                    TokenStorage store = rmd.getTokenStorage();
                    if(store.getToken(id) == null) {
                        Token token = new Token(id, (OMElement)assertion.toDOM(), created, expires);
                        token.setSecret(samlKi.getSecret());
                        store.add(token);
                    }
                } catch (Exception e) {
                    throw new RampartException(
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.