Examples of RequestAbstractType


Examples of org.opensaml.saml2.core.RequestAbstractType

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {
        RequestAbstractType req = (RequestAbstractType) parentSAMLObject;

        if (childSAMLObject instanceof Issuer) {
            req.setIssuer((Issuer) childSAMLObject);
        } else if (childSAMLObject instanceof Signature) {
            req.setSignature((Signature) childSAMLObject);
        } else if (childSAMLObject instanceof Extensions) {
            req.setExtensions((Extensions) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestAbstractType

     * */
    protected String getIntendedDestinationEndpointURI(SAMLMessageContext samlMsgCtx) throws MessageDecodingException {
        SAMLObject samlMessage = samlMsgCtx.getInboundSAMLMessage();
        String messageDestination = null;
        if (samlMessage instanceof RequestAbstractType) {
            RequestAbstractType request =  (RequestAbstractType) samlMessage;
            messageDestination = DatatypeHelper.safeTrimOrNullString(request.getDestination());
        } else if (samlMessage instanceof StatusResponseType) {
            StatusResponseType response = (StatusResponseType) samlMessage;
            messageDestination = DatatypeHelper.safeTrimOrNullString(response.getDestination());
        } else {
            log.error("Invalid SAML message type encountered: {}", samlMessage.getElementQName().toString());
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType

                return Flows.forwardToSecurityFailurePage(session, realm, uriInfo, "Invalid Request");
            }

            SAML2Object samlObject = documentHolder.getSamlObject();

            RequestAbstractType requestAbstractType = (RequestAbstractType)samlObject;
            String issuer = requestAbstractType.getIssuer().getValue();
            ClientModel client = realm.findClient(issuer);

            if (client == null) {
                event.event(EventType.LOGIN);
                event.error(Errors.CLIENT_NOT_FOUND);
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType

        Document samlDocument = DocumentUtil.getDocument(is);

        SAMLParser samlParser = new SAMLParser();
        JAXPValidationUtil.checkSchemaValidation(samlDocument);
        RequestAbstractType requestType = (RequestAbstractType) samlParser.parse(DocumentUtil.getNodeAsStream(samlDocument));

        samlDocumentHolder = new SAMLDocumentHolder(requestType, samlDocument);
        return requestType;
    }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType

            } else
            // Send valid saml response after processing the request
            if (samlRequestMessage != null) {
                // Get the SAML Request Message
                RequestAbstractType requestAbstractType = null;

                try {
                    samlDocumentHolder = webRequestUtil.getSAMLDocumentHolder(samlRequestMessage);
                    samlObject = samlDocumentHolder.getSamlObject();

                    boolean isPost = webRequestUtil.hasSAMLRequestInPostProfile();
                    boolean isValid = validate(request.getRemoteAddr(), request.getQueryString(), new SessionHolder(
                            samlRequestMessage, null), isPost);

                    if (!isValid)
                        throw new GeneralSecurityException(ErrorCodes.VALIDATION_CHECK_FAILED + "Validation check failed");

                    String issuer = null;
                    IssuerInfoHolder idpIssuer = new IssuerInfoHolder(this.identityURL);
                    ProtocolContext protocolContext = new HTTPContext(request, response, context);
                    // Create the request/response
                    SAML2HandlerRequest saml2HandlerRequest = new DefaultSAML2HandlerRequest(protocolContext,
                            idpIssuer.getIssuer(), samlDocumentHolder, HANDLER_TYPE.IDP);
                    saml2HandlerRequest.setRelayState(relayState);

                    // Set the options on the handler request
                    Map<String, Object> requestOptions = new HashMap<String, Object>();
                    requestOptions.put(GeneralConstants.ROLE_GENERATOR, roleGenerator);
                    requestOptions.put(GeneralConstants.CONFIGURATION, this.idpConfiguration);

                    Map<String, Object> attribs = this.attribManager.getAttributes(userPrincipal, attributeKeys);
                    requestOptions.put(GeneralConstants.ATTRIBUTES, attribs);

                    saml2HandlerRequest.setOptions(requestOptions);

                    List<String> roles = (List<String>) session.getAttribute(GeneralConstants.ROLES_ID);
                    if (roles == null) {
                        roles = roleGenerator.generateRoles(userPrincipal);
                        session.setAttribute(GeneralConstants.ROLES_ID, roles);
                    }

                    SAML2HandlerResponse saml2HandlerResponse = new DefaultSAML2HandlerResponse();

                    Set<SAML2Handler> handlers = chain.handlers();

                    if (samlObject instanceof RequestAbstractType) {
                        requestAbstractType = (RequestAbstractType) samlObject;
                        issuer = requestAbstractType.getIssuer().getValue();
                        webRequestUtil.isTrusted(issuer);

                        if (handlers != null) {
                            for (SAML2Handler handler : handlers) {
                                handler.handleRequestType(saml2HandlerRequest, saml2HandlerResponse);
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType

        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream is = tcl.getResourceAsStream(resourceName);

        SAMLParser parser = new SAMLParser();
        RequestAbstractType req = (RequestAbstractType) parser.parse(is);
        assertNotNull(req);
        assertTrue(req instanceof XACMLAuthzDecisionQueryType);

        XACMLAuthzDecisionQueryType xadqt = (XACMLAuthzDecisionQueryType) req;
        RequestType requestType = xadqt.getRequest();
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType

        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream is = tcl.getResourceAsStream(resourceName);

        SAMLParser parser = new SAMLParser();
        RequestAbstractType req = (RequestAbstractType) parser.parse(is);
        assertNotNull(req);
        assertTrue(req instanceof XACMLAuthzDecisionQueryType);

        XACMLAuthzDecisionQueryType xadqt = (XACMLAuthzDecisionQueryType) req;
        RequestType requestType = xadqt.getRequest();
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType

            if (!(samlObject instanceof RequestAbstractType)) {
                throw logger.wrongTypeError(samlObject.getClass().getName());
            }

            // Get the SAML Request Message
            RequestAbstractType requestAbstractType = (RequestAbstractType) samlObject;
            String issuer = requestAbstractType.getIssuer().getValue();

            if (samlRequestMessage == null)
                throw logger.samlIDPValidationCheckFailed();

            IssuerInfoHolder idpIssuer = new IssuerInfoHolder(getIdentityURL());
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType

    }

    private class IDPTrustHandler {
        public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response, IDPType idpConfiguration)
                throws ProcessingException {
            RequestAbstractType requestType = (RequestAbstractType) request.getSAML2Object();
           
            if (requestType == null)
                throw logger.nullValueError("AuthnRequest");
           
            String issuer = requestType.getIssuer().getValue();

            trustIssuer(idpConfiguration, issuer);
        }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType

        String request = RedirectBindingUtil.deflateBase64URLEncode(sw.toString());

        InputStream is = RedirectBindingUtil.urlBase64DeflateDecode(request);

        RequestAbstractType parsed = saml2Request.getRequestType(is);
        assertNotNull("Parsed request is not null", parsed);
        assertTrue("AuthnRequestType", parsed instanceof AuthnRequestType);
    }
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.