Package org.picketlink.identity.federation.core.saml.v2.interfaces

Examples of org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerConfig


        SAML2Response saml2Response = new SAML2Response();

        // Create a response type
        String id = IDGenerator.create("ID_");

        IssuerInfoHolder issuerHolder = new IssuerInfoHolder("http://identityurl");
        issuerHolder.setStatusCode(JBossSAMLURIConstants.STATUS_SUCCESS.get());

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue("testPrincipal");
        idp.setNameIDFormat(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get());
View Full Code Here


    public void testResponseTypeCreation() throws Exception {
        // Initialize the Core STS
        PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
        sts.installDefaultConfiguration();

        IssuerInfoHolder issuerHolder = new IssuerInfoHolder("http://idp");
        issuerHolder.setStatusCode(JBossSAMLURIConstants.STATUS_SUCCESS.get());

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue(IDGenerator.create());

        SAML2Response saml2Response = new SAML2Response();
View Full Code Here

        attributes.put(X500SAMLProfileConstants.EMAIL_ADDRESS.getFriendlyName(), "test@a");
        attributes.put(X500SAMLProfileConstants.GIVEN_NAME.getFriendlyName(), "anil");

        AttributeStatementType attrStat = StatementUtil.createAttributeStatement(attributes);

        IssuerInfoHolder issuerHolder = new IssuerInfoHolder("http://idp");
        issuerHolder.setStatusCode(JBossSAMLURIConstants.STATUS_SUCCESS.get());

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue(IDGenerator.create());

        ResponseType rt = JBossSAMLAuthnResponseFactory
View Full Code Here

    @Test
    public void constructAndSign() throws Exception {
        SAML2Response samlResponse = new SAML2Response();
        String ID = IDGenerator.create("ID_");

        IssuerInfoHolder issuerInfo = new IssuerInfoHolder("picketlink");

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue("anil");

        // create the service provider(in this case BAS) holder object
        SPInfoHolder sp = new SPInfoHolder();
        sp.setResponseDestinationURI("http://sombody");

        Map<String, Object> attributes = new HashMap<String, Object>();

        attributes.put("TOKEN_USER_ID", String.valueOf(2));
        attributes.put("TOKEN_ORGANIZATION_DISPLAY_NAME", "Test Org");
        attributes.put("TOKEN_USER_DISPLAY_NAME", "Test User");

        AttributeStatementType attributeStatement = StatementUtil.createAttributeStatement(attributes);

        String assertionId = IDGenerator.create("ID_");

        AssertionType assertion = AssertionUtil.createAssertion(assertionId, issuerInfo.getIssuer());
        assertion.addStatement(attributeStatement);

        ResponseType responseType = samlResponse.createResponseType(ID, sp, idp, issuerInfo, assertion);
        SAML2Signature sig = new SAML2Signature();
        Document signedDoc = sig.sign(responseType, getKeyPair());
View Full Code Here

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue(userPrincipal);
        idp.setNameIDFormat(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get());

        SPInfoHolder sp = new SPInfoHolder();
        sp.setResponseDestinationURI(destination);
        sp.setRequestID(requestID);
        sp.setIssuer(requestIssuer);
        responseType = saml2Response.createResponseType(id, sp, idp, issuerHolder);

        // Add information on the roles
        AssertionType assertion = responseType.getAssertions().get(0).getAssertion();
View Full Code Here

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue(null);
        idp.setNameIDFormat(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get());

        SPInfoHolder sp = new SPInfoHolder();
        sp.setResponseDestinationURI(destination);

        responseType = saml2Response.createResponseType(id);
        responseType.setStatus(JBossSAMLAuthnResponseFactory.createStatusTypeForResponder(status));
        responseType.setDestination(destination);
View Full Code Here

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue(null);
        idp.setNameIDFormat(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get());

        SPInfoHolder sp = new SPInfoHolder();
        sp.setResponseDestinationURI(responseURL);

        responseType = saml2Response.createResponseType(id);
        responseType.setStatus(JBossSAMLAuthnResponseFactory.createStatusType(status));

        // Lets see how the response looks like
View Full Code Here

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue("testPrincipal");
        idp.setNameIDFormat(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get());

        SPInfoHolder sp = new SPInfoHolder();
        sp.setResponseDestinationURI("http://service");
        sp.setIssuer("http://service.issuer");
        responseType = saml2Response.createResponseType(id, sp, idp, issuerHolder);
        AssertionType assertion = responseType.getAssertions().get(0).getAssertion();

        AttributeStatementType attrStatement = StatementUtil.createAttributeStatement(roles);
        assertion.addStatement(attrStatement);
View Full Code Here

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue(IDGenerator.create());

        SAML2Response saml2Response = new SAML2Response();

        SPInfoHolder sp = new SPInfoHolder();
        sp.setResponseDestinationURI("http://fakesp");
        sp.setIssuer("http://fakesp");
        ResponseType rt = saml2Response.createResponseType("response111", sp, idp, issuerHolder);
        Assert.assertNotNull(rt);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        saml2Response.marshall(rt, baos);
View Full Code Here

        IDPInfoHolder idp = new IDPInfoHolder();
        idp.setNameIDFormatValue(IDGenerator.create());

        ResponseType rt = JBossSAMLAuthnResponseFactory
                .createResponseType("response111", new SPInfoHolder(), idp, issuerHolder);
        assertNotNull(rt);

        AssertionType assertion = rt.getAssertions().get(0).getAssertion();
        assertion.addStatement(attrStat);
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerConfig

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.