Package org.picketlink.identity.federation.ws.policy

Examples of org.picketlink.identity.federation.ws.policy.AppliesTo


        logger.trace("Issuing token for principal " + callerPrincipal);

        // SecurityTokenProvider provider = null;

        // first try to obtain the security token provider using the applies-to contents.
        AppliesTo appliesTo = request.getAppliesTo();
        X509Certificate providerCertificate = null;
        PublicKey providerPublicKey = null;
        if (appliesTo != null) {
            String serviceName = WSTrustUtil.parseAppliesTo(appliesTo);
View Full Code Here


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

        // lifetime and audience restrictions.
        Lifetime lifetime = wstContext.getRequestSecurityToken().getLifetime();
        SAML11AudienceRestrictionCondition restriction = null;
        AppliesTo appliesTo = wstContext.getRequestSecurityToken().getAppliesTo();
        if (appliesTo != null) {
            restriction = new SAML11AudienceRestrictionCondition();
            restriction.add(URI.create(WSTrustUtil.parseAppliesTo(appliesTo)));
        }
        SAML11ConditionsType conditions = new SAML11ConditionsType();
View Full Code Here

                String elementName = StaxParserUtil.getStartElementName(startElement);
                if (elementName.equalsIgnoreCase(WSPolicyConstants.APPLIES_TO)) {
                    // Get the AppliesTo element
                    startElement = StaxParserUtil.getNextStartElement(xmlEventReader);

                    AppliesTo appliesTo = new AppliesTo();

                    // Now we do not do anything to the applies to element. We go further
                    startElement = StaxParserUtil.peekNextStartElement(xmlEventReader);

                    QName qname = startElement.getName();
                    ParserNamespaceSupport parser = ParserController.get(qname);
                    if (parser == null)
                        throw new RuntimeException(ErrorCodes.UNKNOWN_TAG + qname);

                    Object parsedObject = parser.parse(xmlEventReader);
                    appliesTo.addAny(parsedObject);

                    EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
                    StaxParserUtil.validate(endElement, WSPolicyConstants.APPLIES_TO);
                    return appliesTo;
                }
View Full Code Here

            new WSSecurityWriter(this.writer).writeLifetime(lifetime.getCreated(), lifetime.getExpires());
            StaxUtil.writeEndElement(this.writer);
        }

        // Deal with AppliesTo
        AppliesTo appliesTo = requestToken.getAppliesTo();
        if (appliesTo != null) {
            WSPolicyWriter wsPolicyWriter = new WSPolicyWriter(this.writer);
            wsPolicyWriter.write(appliesTo);
        }
View Full Code Here

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

        // lifetime and audience restrictions.
        Lifetime lifetime = context.getRequestSecurityToken().getLifetime();
        AudienceRestrictionType restriction = null;
        AppliesTo appliesTo = context.getRequestSecurityToken().getAppliesTo();
        if (appliesTo != null)
            restriction = SAMLAssertionFactory.createAudienceRestriction(WSTrustUtil.parseAppliesTo(appliesTo));
        ConditionsType conditions = SAMLAssertionFactory.createConditions(lifetime.getCreated(), lifetime.getExpires(),
                restriction);
View Full Code Here

    public static AppliesTo createAppliesTo(String endpointURI) {
        AttributedURIType attributedURI = new AttributedURIType();
        attributedURI.setValue(endpointURI);
        EndpointReferenceType reference = new EndpointReferenceType();
        reference.setAddress(attributedURI);
        AppliesTo appliesTo = new AppliesTo();
        appliesTo.addAny(reference);

        return appliesTo;
    }
View Full Code Here

    }

    public static String getServiceNameFromAppliesTo(RequestSecurityToken requestSecurityToken) {
        String serviceName = null;
        if (requestSecurityToken != null) {
            AppliesTo appliesTo = requestSecurityToken.getAppliesTo();
            if (appliesTo != null) {
                serviceName = WSTrustUtil.parseAppliesTo(appliesTo);
            }
        }
        return serviceName;
View Full Code Here

        RequestSecurityToken requestToken = (RequestSecurityToken) parser.parse(configStream);

        assertEquals("testcontext", requestToken.getContext());
        assertEquals(WSTrustConstants.ISSUE_REQUEST, requestToken.getRequestType().toASCIIString());

        AppliesTo appliesTo = requestToken.getAppliesTo();
        EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
        assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());

        assertEquals("http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey", requestToken.getKeyType().toASCIIString());

        UseKeyType useKeyType = requestToken.getUseKey();
View Full Code Here

        RequestSecurityToken requestToken = (RequestSecurityToken) parser.parse(configStream);

        assertEquals("testcontext", requestToken.getContext());
        assertEquals(WSTrustConstants.ISSUE_REQUEST, requestToken.getRequestType().toASCIIString());

        AppliesTo appliesTo = requestToken.getAppliesTo();
        EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
        assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);
View Full Code Here

        RequestSecurityToken requestToken = (RequestSecurityToken) parser.parse(configStream);

        assertEquals("testcontext", requestToken.getContext());
        assertEquals(WSTrustConstants.ISSUE_REQUEST, requestToken.getRequestType().toASCIIString());

        AppliesTo appliesTo = requestToken.getAppliesTo();
        EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
        assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());

        assertEquals(WSTrustConstants.BS_TYPE_SYMMETRIC, requestToken.getKeyType().toASCIIString());

        EntropyType entropy = requestToken.getEntropy();
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.ws.policy.AppliesTo

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.