Package org.apache.ws.security.saml.ext.bean

Examples of org.apache.ws.security.saml.ext.bean.AudienceRestrictionBean


            }
        } else {
            conditions.setTokenPeriodMinutes(5);
        }
        if (appliesToAddress != null) {
            AudienceRestrictionBean audienceRestriction = new AudienceRestrictionBean();
            audienceRestriction.setAudienceURIs(Collections.singletonList(appliesToAddress));
            conditions.setAudienceRestrictions(Collections.singletonList(audienceRestriction));
        }
       
        return conditions;
    }
View Full Code Here


     * @return an AudienceRestrictionCondition object
     */
    @Deprecated
    public static AudienceRestrictionCondition
    createSamlv1AudienceRestriction(String audienceURI) {
        AudienceRestrictionBean audienceRestrictionBean = new AudienceRestrictionBean();
        audienceRestrictionBean.setAudienceURIs(Collections.singletonList(audienceURI));
        return createSamlv1AudienceRestriction(audienceRestrictionBean);
    }
View Full Code Here

     * @param audienceURI of type String
     * @return an AudienceRestriction object
     */
    @Deprecated
    public static AudienceRestriction createAudienceRestriction(String audienceURI) {
        AudienceRestrictionBean audienceRestrictionBean = new AudienceRestrictionBean();
        audienceRestrictionBean.setAudienceURIs(Collections.singletonList(audienceURI));
        return createAudienceRestriction(audienceRestrictionBean);
    }
View Full Code Here

        updateAddressPort(saml2Port, PORT2);

        // Create a SAML Token with an AudienceRestrictionCondition
        ConditionsBean conditions = new ConditionsBean();
        List<AudienceRestrictionBean> audienceRestrictions = new ArrayList<AudienceRestrictionBean>();
        AudienceRestrictionBean audienceRestriction = new AudienceRestrictionBean();
        audienceRestriction.setAudienceURIs(Collections.singletonList(
            "https://localhost:" + PORT2 + "/DoubleItSaml2Transport2"));
        audienceRestrictions.add(audienceRestriction);
        conditions.setAudienceRestrictions(audienceRestrictions);
       
        SamlCallbackHandler callbackHandler = new SamlCallbackHandler();
        callbackHandler.setConditions(conditions);
        ((BindingProvider)saml2Port).getRequestContext().put(
            "ws-security.saml-callback-handler", callbackHandler
        );
       
        saml2Port.doubleIt(25);
       
        try {
            // Now use an "unknown" audience restriction
            audienceRestriction = new AudienceRestrictionBean();
            audienceRestriction.setAudienceURIs(Collections.singletonList(
                "https://localhost:" + PORT2 + "/DoubleItSaml2Transport2unknown"));
            audienceRestrictions.clear();
            audienceRestrictions.add(audienceRestriction);
            conditions.setAudienceRestrictions(audienceRestrictions);
            callbackHandler.setConditions(conditions);
View Full Code Here

            }
        } else {
            conditions.setTokenPeriodMinutes(5);
        }
        if (appliesToAddress != null) {
            AudienceRestrictionBean audienceRestriction = new AudienceRestrictionBean();
            audienceRestriction.setAudienceURIs(Collections.singletonList(appliesToAddress));
            conditions.setAudienceRestrictions(Collections.singletonList(audienceRestriction));
        }
       
        return conditions;
    }
View Full Code Here

        Participants participants = providerParameters.getTokenRequirements().getParticipants();
        if (participants != null) {
            String address =
                extractAddressFromParticipantsEPR(participants.getPrimaryParticipant());
            if (address != null) {
                AudienceRestrictionBean audienceRestriction = new AudienceRestrictionBean();
                audienceRestriction.setAudienceURIs(Collections.singletonList(address));
                audienceRestrictions.add(audienceRestriction);
            }

            if (participants.getParticipants() != null) {
                for (Object participant : participants.getParticipants()) {
                    if (participant != null) {
                        address = extractAddressFromParticipantsEPR(participant);
                        if (address != null) {
                            AudienceRestrictionBean audienceRestriction = new AudienceRestrictionBean();
                            audienceRestriction.setAudienceURIs(Collections.singletonList(address));
                            audienceRestrictions.add(audienceRestriction);
                        }
                    }
                }
            }
View Full Code Here

        ConditionsBean conditions = new ConditionsBean();
        conditions.setTokenPeriodMinutes(5);
        List<String> audiences = new ArrayList<String>();
        audiences.add("http://apache.org/one");
        audiences.add("http://apache.org/two");
        AudienceRestrictionBean audienceRestrictionBean = new AudienceRestrictionBean();
        audienceRestrictionBean.setAudienceURIs(audiences);
        conditions.setAudienceRestrictions(Collections.singletonList(audienceRestrictionBean));
       
        callbackHandler.setConditions(conditions);
       
        SAMLParms samlParms = new SAMLParms();
View Full Code Here

        ConditionsBean conditions = new ConditionsBean();
        conditions.setTokenPeriodMinutes(5);
       
        List<AudienceRestrictionBean> audiencesRestrictions =
            new ArrayList<AudienceRestrictionBean>();
        AudienceRestrictionBean audienceRestrictionBean = new AudienceRestrictionBean();
        audienceRestrictionBean.setAudienceURIs(Collections.singletonList("http://apache.org/one"));
        audiencesRestrictions.add(audienceRestrictionBean);

        audienceRestrictionBean = new AudienceRestrictionBean();
        audienceRestrictionBean.setAudienceURIs(Collections.singletonList("http://apache.org/two"));
        audiencesRestrictions.add(audienceRestrictionBean);

        conditions.setAudienceRestrictions(audiencesRestrictions);
       
        callbackHandler.setConditions(conditions);
View Full Code Here

TOP

Related Classes of org.apache.ws.security.saml.ext.bean.AudienceRestrictionBean

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.