Package org.opensaml.xacml.ctx

Examples of org.opensaml.xacml.ctx.RequestType


        attributes.clear();
        attributes.add(actionAttribute);
        ActionType action = RequestComponentBuilder.createActionType(attributes);
       
        // Request
        RequestType request =
            RequestComponentBuilder.createRequestType(
                    Collections.singletonList(subject),
                    Collections.singletonList(resource),
                    action,
                    null
View Full Code Here


        attributes.add(environmentAttribute);
        EnvironmentType environmentType =
             RequestComponentBuilder.createEnvironmentType(attributes);
       
        // Request
        RequestType request =
            RequestComponentBuilder.createRequestType(
                    Collections.singletonList(subject),
                    Collections.singletonList(resource),
                    action,
                    environmentType
View Full Code Here

        MessageImpl msg = new MessageImpl();
        String resourceURL = "https://localhost:8080/doubleit";
        msg.put(Message.REQUEST_URL, resourceURL);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        List<ResourceType> resources = request.getResources();
        assertNotNull(resources);
        assertEquals(1, resources.size());
       
        ResourceType resource = resources.get(0);
        assertEquals(1, resource.getAttributes().size());
View Full Code Here

        String resourceURI = "/doubleit";
        msg.put(Message.REQUEST_URI, resourceURI);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        ((DefaultXACMLRequestBuilder)builder).setSendFullRequestURL(false);
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        List<ResourceType> resources = request.getResources();
        assertNotNull(resources);
        assertEquals(1, resources.size());
       
        ResourceType resource = resources.get(0);
        assertEquals(1, resource.getAttributes().size());
View Full Code Here

        }
        EnvironmentType environmentType =
            RequestComponentBuilder.createEnvironmentType(attributes);
       
        // Request
        RequestType request =
            RequestComponentBuilder.createRequestType(
                Collections.singletonList(subjectType),
                Collections.singletonList(resourceType),
                actionType,
                environmentType
View Full Code Here

        String operation = "{http://www.example.org/contract/DoubleIt}DoubleIt";
        MessageImpl msg = new MessageImpl();
        msg.put(Message.WSDL_OPERATION, operation);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
    }
View Full Code Here

        String operation = "{http://www.example.org/contract/DoubleIt}DoubleIt";
        MessageImpl msg = new MessageImpl();
        msg.put(Message.WSDL_OPERATION, operation);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        assertTrue(builder.getResources(msg).contains(operation));
       
View Full Code Here

        String operation = "{http://www.example.org/contract/DoubleIt}DoubleIt";
        MessageImpl msg = new MessageImpl();
        msg.put(Message.WSDL_OPERATION, operation);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        String action =
            request.getAction().getAttributes().get(0).getAttributeValues().get(0).getValue();
        assertEquals(action, "execute");
       
        ((DefaultXACMLRequestBuilder)builder).setAction("write");
        request = builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        action =
            request.getAction().getAttributes().get(0).getAttributeValues().get(0).getValue();
        assertEquals(action, "write");
    }
View Full Code Here

        String operation = "{http://www.example.org/contract/DoubleIt}DoubleIt";
        MessageImpl msg = new MessageImpl();
        msg.put(Message.WSDL_OPERATION, operation);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
        assertFalse(request.getEnvironment().getAttributes().isEmpty());
       
        ((DefaultXACMLRequestBuilder)builder).setSendDateTime(false);
        request = builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
        assertTrue(request.getEnvironment().getAttributes().isEmpty());
    }
View Full Code Here

     * Perform a (remote) authorization decision and return a boolean depending on the result
     */
    protected boolean authorize(
        Principal principal, List<String> roles, Message message
    ) throws Exception {
        RequestType request = requestBuilder.createRequest(principal, roles, message);
        if (LOG.isLoggable(Level.FINE)) {
            Document doc = DOMUtils.createDocument();
            Element requestElement = OpenSAMLUtil.toDom(request, doc);
            LOG.log(Level.FINE, DOM2Writer.nodeToString(requestElement));
        }
View Full Code Here

TOP

Related Classes of org.opensaml.xacml.ctx.RequestType

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.