Examples of SAMLException


Examples of com.sun.xml.wss.saml.SAMLException

           
            signedAssertion = assertionElement;
            return assertionElement;
        } catch (Exception ex) {
            // log here
            throw new SAMLException(ex);
        }
        //return signedAssertion;
    }       
View Full Code Here

Examples of com.sun.xml.wss.saml.SAMLException

            signature.sign(dsc);

            signedAssertion = assertionElement;
            return assertionElement;
        } catch (XWSSecurityException ex) {
            throw new SAMLException(ex);
        } catch (MarshalException ex) {
            throw new SAMLException(ex);
        } catch (NoSuchAlgorithmException ex) {
            throw new SAMLException(ex);
        } catch (SOAPException ex) {
            throw new SAMLException(ex);
        } catch (XMLSignatureException ex) {
            throw new SAMLException(ex);
        } catch (InvalidAlgorithmParameterException ex) {
            throw new SAMLException(ex);
        }
    }
View Full Code Here

Examples of org.opensaml.SAMLException

            //create the SAMLResponse           
            authResponse.addAssertion(authAssertion);
         }
         else
         {
            SAMLException loginFailed = new SAMLException(LOGIN_FAILED);
            authResponse.setStatus(loginFailed);
         }
        
         response = authResponse.toString();
        
View Full Code Here

Examples of org.opensaml.SAMLException

        throws Exception {
        final WebApplicationService service = this.samlArgumentExtractor.extractService(request);
        final String artifactId = service != null ? service.getArtifactId() : null;
        final String serviceId = service != null ? service.getId() : "UNKNOWN";
        final String errorMessage = (String) model.get("description");
        final SAMLResponse samlResponse = new SAMLResponse(artifactId, serviceId, new ArrayList<Object>(), new SAMLException(errorMessage));
        samlResponse.setIssueInstant(new Date());

        response.setContentType("text/xml; charset=" + this.encoding);
        response.getWriter().print("<?xml version=\"1.0\" encoding=\"" + this.encoding + "\"?>");
        response.getWriter().print("<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP-ENV:Header/><SOAP-ENV:Body>");
View Full Code Here

Examples of org.opensaml.common.SAMLException

            index.setSessionIndex(statement.getSessionIndex());
            request.getSessionIndexes().add(index);
        }

        if (request.getSessionIndexes().size() == 0) {
            throw new SAMLException("No session indexes to logout user for were found");
        }

        SAMLObjectBuilder<NameID> nameIDBuilder = (SAMLObjectBuilder<NameID>) builderFactory.getBuilder(NameID.DEFAULT_ELEMENT_NAME);
        NameID nameID = nameIDBuilder.buildObject();
        nameID.setFormat(credential.getNameID().getFormat());
View Full Code Here

Examples of org.pac4j.saml.exceptions.SamlException

        }

        try {
            encoder.encode(context);
        } catch (MessageEncodingException e) {
            throw new SamlException("Error encoding saml message", e);
        }

    }
View Full Code Here

Examples of org.pac4j.saml.exceptions.SamlException

        context.setSecurityPolicyResolver(resolver);

        try {
            decoder.decode(context);
        } catch (MessageDecodingException e) {
            throw new SamlException("Error decoding saml message", e);
        } catch (SecurityException e) {
            throw new SamlException("Error decoding saml message", e);
        }

        if (context.getPeerEntityMetadata() == null) {
            throw new SamlException("IDP Metadata cannot be null");
        }

        context.setPeerEntityId(context.getPeerEntityMetadata().getEntityID());
        context.setCommunicationProfileId(SAML2_WEBSSO_PROFILE_URI);
    }
View Full Code Here

Examples of org.pac4j.saml.exceptions.SamlException

            final Decrypter decrypter) {

        SAMLObject message = context.getInboundSAMLMessage();

        if (!(message instanceof Response)) {
            throw new SamlException("Response instance is an unsupported type");
        }
        Response response = (Response) message;

        validateSamlProtocolResponse(response, context, engine);
View Full Code Here

Examples of org.pac4j.saml.exceptions.SamlException

     */
    public void validateSamlProtocolResponse(final Response response, final ExtendedSAMLMessageContext context,
            final SignatureTrustEngine engine) {

        if (!isIssueInstantValid(response.getIssueInstant())) {
            throw new SamlException("Response issue instant is too old or in the future");
        }

        // TODO add Destination and inResponseTo Validation

        if (response.getIssuer() != null) {
            validateIssuer(response.getIssuer(), context);
        }

        if (!StatusCode.SUCCESS_URI.equals(response.getStatus().getStatusCode().getValue())) {
            String status = response.getStatus().getStatusCode().getValue();
            if (response.getStatus().getStatusMessage() != null) {
                status += " / " + response.getStatus().getStatusMessage().getMessage();
            }
            throw new SamlException("Authentication response is not success ; actual " + status);
        }

        if (response.getSignature() != null) {
            validateSignature(response.getSignature(), context.getPeerEntityId(), engine);
            context.setInboundSAMLMessageAuthenticated(true);
View Full Code Here

Examples of org.pac4j.saml.exceptions.SamlException

                break;
            }
        }

        if (context.getSubjectAssertion() == null) {
            throw new SamlException("No valid subject assertion found in response");
        }

        // We do not check EncryptedID here because it has been already decrypted and stored into NameID
        List<SubjectConfirmation> subjectConfirmations = context.getSubjectConfirmations();
        if ((context.getSubjectNameIdentifier() == null) && (context.getBaseID() == null)
                && ((subjectConfirmations == null) || (subjectConfirmations.size() == 0))) {
            throw new SamlException(
                    "Subject NameID, BaseID and EncryptedID cannot be both null at the same time if there are no Subject Confirmations.");
        }
    }
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.