Package org.picketlink.identity.federation.api.saml.v2.response

Examples of org.picketlink.identity.federation.api.saml.v2.response.SAML2Response.marshall()


         //Lets see how the response looks like
         if(log.isTraceEnabled())
         {
            log.trace("ResponseType = ");
            StringWriter sw = new StringWriter();
            saml2Response.marshall(responseType, sw);
            log.trace("IDPRedirectValve::Response="+sw.toString());
         }

         return responseType;      
     
View Full Code Here


            int keyLength = enc.getKeySize();
            //Generate a key on the fly
            SecretKey sk = keyManager.getEncryptionKey(spurl.getHost(), encAlgo, keyLength);
           
            StringWriter sw = new StringWriter();
            saml2Response.marshall(responseType, sw);
           
            Document responseDoc = DocumentUtil.getDocument(new StringReader(sw.toString()))
     
            String assertionNS = JBossSAMLURIConstants.ASSERTION_NSURI.get();
           
View Full Code Here

      if(log.isTraceEnabled())
      {
         StringWriter sw = new StringWriter();
         try
         {
            saml2Response.marshall(responseType, sw);
         }
         catch (JAXBException e)
         {
            if(trace) log.trace(e);
         }
View Full Code Here

        SAML2Request saml2Request = new SAML2Request();

        // Deal with the original request
        StringWriter sw = new StringWriter();

        saml2Request.marshall(authRequest, sw);

        // URL Encode the Request
        String urlEncodedRequest = RedirectBindingUtil.deflateBase64URLEncode(sw.toString());

        String urlEncodedRelayState = null;
View Full Code Here

        assertEquals("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport", requestedAuthnContext
                .getAuthnContextClassRef().get(0));

        // Let us marshall it back to an output stream
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        request.marshall(authnRequestType, baos);
    }

    /**
     * Test reading a saml authn request from a file that contains a digital signature
     *
 
View Full Code Here

        Element signatureType = authnRequestType.getSignature();
        assertNotNull("Signature is not null", signatureType);

        // Let us marshall it back to an output stream
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        request.marshall(authnRequestType, baos);
    }

    /**
     * Test the creation of AuthnRequestType
     *
 
View Full Code Here

        NameIDPolicyType nameIDPolicy = authnRequest.getNameIDPolicy();
        assertNotNull("NameIDPolicy is not null", nameIDPolicy);
        assertTrue(nameIDPolicy.isAllowCreate());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        request.marshall(authnRequest, baos);
    }
}
View Full Code Here

        NameIDType nameID = new NameIDType();
        nameID.setValue(userPrincipal.getName());
        lot.setNameID(nameID);

        StringWriter sw = new StringWriter();
        samlRequest.marshall(lot, sw);
        return sw.toString();
    }

    // Get the Identity server with 2 participants
    private IdentityServer getIdentityServer(HttpSession session) {
View Full Code Here

        AuthnRequestType authnRequest = (new SAML2Request()).createAuthnRequestType(IDGenerator.create("ID_"), "http://sp",
                "http://localhost:8080/idp", "http://sp");

        StringWriter sw = new StringWriter();
        SAML2Request request = new SAML2Request();
        request.marshall(authnRequest, sw);
        byte[] deflatedMsg = DeflateUtil.encode(sw.toString());

        String base64Request = Base64.encodeBytes(deflatedMsg, Base64.DONT_BREAK_LINES);

        base64Request = URLEncoder.encode(base64Request, "UTF-8");
View Full Code Here

    private String createLogOutRequest(String url) throws Exception {
        SAML2Request samlRequest = new SAML2Request();
        LogoutRequestType lot = samlRequest.createLogoutRequest(url);
        StringWriter sw = new StringWriter();
        samlRequest.marshall(lot, sw);
        return sw.toString();
    }

    // Get the Identity server with 2 participants
    private IdentityServer getIdentityServer(HttpSession session) {
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.