GithubHelp home page GithubHelp logo

java-saml's Introduction

SAML Java Toolkit

Build Status Coverage Status

Add SAML support to your Java applications using this library.

2.8.0 uses xmlsec 2.2.3 which fixes CVE-2021-40690

Version >= 2.5.0 compatible with java8 / java9. Not compatible with java7

2.5.0 sets the 'strict' setting parameter to true.

2.5.0 uses xmlsec 2.1.4 which fixes CVE-2019-12400

Version 2.0.0 - 2.4.0, compatible with java7 / java8.

We introduced some incompatibilities, that could be fixed and make it compatible with java6.

Version 1.1.2 is considered to be deprecated. If you have used it, we strongly recommend that you migrate to the new version. We rebuilt the toolkit on 2.0.0, so code/settings that you had been using in the previous version will no longer be compatible.

Why add SAML support to my software?

SAML is an XML-based standard for web browser single sign-on and is defined by the OASIS Security Services Technical Committee. The standard has been around since 2002, but lately it has become popular due to its advantages as follows:

  • Usability - One-click access from portals or intranets, deep linking, password elimination and automatically renewing sessions make life easier for the user.
  • Security - Based on strong digital signatures for authentication and integrity, SAML is a secure single sign-on protocol that the largest and most security conscious enterprises in the world rely on.
  • Speed - SAML is fast. One browser redirect is all it takes to securely sign a user into an application.
  • Phishing Prevention - If you don’t have a password for an app, you can’t be tricked into entering it on a fake login page.
  • IT Friendly - SAML simplifies life for IT because it centralizes authentication, provides greater visibility and makes directory integration easier.
  • Opportunity - B2B cloud vendor should support SAML to facilitate the integration of their product.

General description

SAML Java toolkit lets you turn a Java application into a SP (Service Provider) that can be connected to an IdP (Identity Provider).

Supports:

  • SSO and SLO (SP-Initiated and IdP-Initiated).
  • Assertion and nameId encryption.
  • Assertion signatures.
  • Message signatures: AuthNRequest, LogoutRequest, LogoutResponses.
  • Enable an Assertion Consumer Service endpoint.
  • Enable a Single Logout Service endpoint.
  • Publish the SP metadata (which can be signed).

Key features:

  • saml2int - Implements the SAML 2.0 Web Browser SSO Profile.
  • Session-less - Forget those common conflicts between the SP and the final app; the toolkit delegates session in the final app.
  • Easy to use - Programmer will be allowed to code high-level and low-level programming; 2 easy-to-use APIs are available.
  • Tested - Thoroughly tested.

Security warning

In production, the onelogin.saml2.strict setting parameter MUST be set as "true". Otherwise your environment is not secure and will be exposed to attacks.

In production also we highly recommend to register on the settings the IdP certificate instead of using the fingerprint method. The fingerprint, is a hash, so at the end is open to a collision attack that can end on a signature validation bypass. Other SAML toolkits deprecated that mechanism, we maintain it for compatibility and also to be used on test environment.

The IdPMetadataParser class does not validate in any way the URL that is introduced in order to be parsed.

Usually the same administrator that handles the Service Provider also sets the URL to the IdP, which should be a trusted resource.

But there are other scenarios, like a SAAS app where the administrator of the app delegates this functionality to other users. In this case, extra precaution should be taken in order to validate such URL inputs and avoid attacks like SSRF.

Installation

Hosting

Github

The toolkit is hosted on github. You can download it from:

Maven

The toolkit is hosted at Sonatype OSSRH (OSS Repository Hosting) that is synced to the Central Repository.

Install it as a maven dependency:

  <dependency>
      <groupId>com.onelogin</groupId>
      <artifactId>java-saml</artifactId>
      <version>2.9.0</version>
  </dependency>

Dependencies

java-saml (com.onelogin:java-saml-toolkit) has the following dependencies:

core:

  • org.apache.santuario:xmlsec
  • joda-time:joda-time
  • org.apache.commons:commons-lang3
  • commons-codec:commons-codec
  • testing:
    • org.hamcrest:hamcrest-core and org.hamcrest:hamcrest-library
    • junit:junit
    • org.mockito:mockito-core
  • logging:
    • org.slf4j:slf4j-api
    • ch.qos.logback:logback-classic
  • For CI:
    • org.jacoco:jacoco-maven-plugin

also the Java Cryptography Extension (JCE) is required. If you don't have it, download the version of jce-8, unzip it, and drop its content at ${java.home}/jre/lib/security/. JDK 9 and later offer the stronger cryptographic algorithms by default.

toolkit:

  • com.onelogin:java-saml-core
  • javax.servlet:servlet-api

maven:

  • org.apache.maven.plugins:maven-jar-plugin
  • org.apache.maven.plugins:maven-surefire-plugin
  • org.apache.maven.plugins:maven-enforcer-plugin

For more info, open and read the different pom.xml files: core/pom.xml, toolkit/pom.xml

Working with the github repository code and Eclipse.

Get the toolkit.

The toolkit is hosted on github. You can download it from:

Adding java-saml toolkit components as a project

  1. Open Eclipse and set a workspace
  2. File > Import > Maven : Existing Maven Projects > Select the path where the core folder of the Java Toolkit is /java-saml/core, resolve the Workspace project and select the pom.xml
  3. File > Import > Maven : Existing Maven Projects > Select the path where the toolkit folder of the Java Toolkit is /java-saml/toolkit, resolve the Workspace project and select the pom.xml

Adding the java-saml-tookit-jspsample as a project

  1. File > Import > Maven : Existing Maven Projects > Select the path where the core folder of the Java Toolkit is /java-saml/samples/java-saml-tookit-jspsample, resolve the Workspace project and select the pom.xml

Deploy the java-saml-tookit-jspsample

At the Package Explorer, select the jsp-sample project, 2nd bottom of the mouse and Run As > Run Server Select a Tomcat Server in order to deploy the server.

Getting started

Learning the toolkit

Java SAML Toolkit contains different folders (core, toolkit, samples) and some files.

Let's start describing them:

core (com.onelogin:java-saml-core)

This folder contains a maven project with the heart of java-saml, classes and methods to handle AuthNRequest, SAMLResponse, LogoutRequest, LogoutResponse and Metadata (low level API). In addition, it contains classes to load the settings of the toolkit and the HttpRequest class, a framework-agnostic representation of an HTTP request.

In the repo, at src/main/java you will find the source; at src/main/resources/schemas, there are xsd schemas used to validate the SAML messages; at src/test/java are the tests for its classes; and at src/test/resources can be found different settings, SAML messages and certificates used by the junit tests.

toolkit (com.onelogin:java-saml)

This folder contains a maven project with the Auth class to handle the low level classes of java-saml-core and the ServletUtils class to handle javax.servlet.http objects, used on the Auth class. In the repo, at src/main/java you will find the source and at src/test/java the junit tests for the classes Auth and ServletUtils.

samples (com.onelogin:java-saml-tookit-samples)

This folder contains a maven project with a jsp app used to learn how the java-saml toolkit works.

Within the java-saml-tookit-jspsample/src/main/webapp folder are several jsp files, each one representing a different endpoint:

  • index.jsp Index of the webapp.
  • dologin.jsp SP-initiated SSO endpoint.
  • dologout.jsp SP-initiated SLO endpoint.
  • acs.jsp Service Provider Assertion Consumer Service endpoint.
  • attrs.jsp Shows attributes collected from the SAMLResponse.
  • sls.jsp Service Provider Single Logout Service endpoint.
  • metadata.jsp Publish SP metadata.

At java-saml-tookit-jspsample/src/main/resources folder is the onelogin.saml.properties file which contains the SAML settings.

How it works

Javadocs

Settings

First of all we need to configure the toolkit. The SP's info, the IdP's info, and in some cases, configuration for advanced security issues, such as signatures and encryption.

Properties File

All the settings are defined in one unique file; by default, the Auth class loads a onelogin.saml.properties file with the Auth() method, but if we named it in a different way, we can use Auth(filename);

Here are the list of properties to be defined on the settings file:

#  If 'strict' is True, then the Java Toolkit will reject unsigned
#  or unencrypted messages if it expects them signed or encrypted
#  Also will reject the messages if not strictly follow the SAML
onelogin.saml2.strict =  false

# Enable debug mode (to print errors)
onelogin.saml2.debug =  false


## Service Provider Data that we are deploying ##

#  Identifier of the SP entity  (must be a URI)
onelogin.saml2.sp.entityid = http://localhost:8080/java-saml-tookit-jspsample/metadata.jsp

# Specifies info about where and how the <AuthnResponse> message MUST be
# returned to the requester, in this case our SP.
# URL Location where the <Response> from the IdP will be returned
onelogin.saml2.sp.assertion_consumer_service.url = http://localhost:8080/java-saml-tookit-jspsample/acs.jsp

# SAML protocol binding to be used when returning the <Response>
# message.  SAMLToolkit supports for this endpoint the
# HTTP-POST binding only
onelogin.saml2.sp.assertion_consumer_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST

# Specifies info about where and how the <Logout Response> message MUST be
# returned to the requester, in this case our SP.
onelogin.saml2.sp.single_logout_service.url = http://localhost:8080/java-saml-tookit-jspsample/sls.jsp

# SAML protocol binding to be used when returning the <LogoutResponse> or sending the <LogoutRequest>
# message.  SAMLToolkit supports for this endpoint the
# HTTP-Redirect binding only
onelogin.saml2.sp.single_logout_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect

# Specifies constraints on the name identifier to be used to
# represent the requested subject.
# Take a look on core/src/main/java/com/onelogin/saml2/util/Constants.java to see the NameIdFormat supported
onelogin.saml2.sp.nameidformat = urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified

# Usually x509cert and privateKey of the SP are provided by files placed at
# the certs folder. But we can also provide them with the following parameters

onelogin.saml2.sp.x509cert =

# Future SP certificate, to be used during SP Key roll over
onelogin.saml2.sp.x509certNew =

# Requires Format PKCS#8   BEGIN PRIVATE KEY
# If you have     PKCS#1   BEGIN RSA PRIVATE KEY  convert it by   openssl pkcs8 -topk8 -inform pem -nocrypt -in sp.rsa_key -outform pem -out sp.pem
onelogin.saml2.sp.privatekey =

# Organization
onelogin.saml2.organization.name = SP Java
onelogin.saml2.organization.displayname = SP Java Example
onelogin.saml2.organization.url = http://sp.example.com
onelogin.saml2.organization.lang = en

# Contacts (use indexes to specify multiple contacts, multiple e-mail addresses per contact, multiple phone numbers per contact)
onelogin.saml2.sp.contact[0].contactType=administrative
onelogin.saml2.sp.contact[0].company=ACME
onelogin.saml2.sp.contact[0].given_name=Guy
onelogin.saml2.sp.contact[0].sur_name=Administrative
onelogin.saml2.sp.contact[0].email_address[0][email protected]
onelogin.saml2.sp.contact[0].email_address[1][email protected]
onelogin.saml2.sp.contact[0].telephone_number[0]=+1-123456789
onelogin.saml2.sp.contact[0].telephone_number[1]=+1-987654321
onelogin.saml2.sp.contact[1].contactType=other
onelogin.saml2.sp.contact[1].company=Big Corp
onelogin.saml2.sp.contact[1].email_address[email protected]

# Legacy contacts (legacy way to specify just a technical and a support contact with minimal info)
onelogin.saml2.contacts.technical.given_name = Technical Guy
onelogin.saml2.contacts.technical.email_address = [email protected]
onelogin.saml2.contacts.support.given_name = Support Guy
onelogin.saml2.contacts.support.email_address = [email protected]

## Identity Provider Data that we want connect with our SP ##

# Identifier of the IdP entity  (must be a URI)
onelogin.saml2.idp.entityid =

# SSO endpoint info of the IdP. (Authentication Request protocol)
# URL Target of the IdP where the SP will send the Authentication Request Message
onelogin.saml2.idp.single_sign_on_service.url =

# SAML protocol binding to be used to deliver the <AuthnRequest> message
# to the IdP.  SAMLToolkit supports for this endpoint the
# HTTP-Redirect binding only
onelogin.saml2.idp.single_sign_on_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect

# SLO endpoint info of the IdP.
# URL Location of the IdP where the SP will send the SLO Request
onelogin.saml2.idp.single_logout_service.url =

# Optional SLO Response endpoint info of the IdP.
# URL Location of the IdP where the SP will send the SLO Response. If left blank, same URL as onelogin.saml2.idp.single_logout_service.url will be used.
# Some IdPs use a separate URL for sending a logout request and response, use this property to set the separate response url
onelogin.saml2.idp.single_logout_service.response.url =

# SAML protocol binding to be used when returning the <Response>
# message.  SAMLToolkit supports for this endpoint the
# HTTP-Redirect binding only
onelogin.saml2.idp.single_logout_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect

# Public x509 certificate of the IdP
onelogin.saml2.idp.x509cert =

# Instead of using the whole x509cert you can use a fingerprint in order to
# validate a SAMLResponse (but you still need the x509cert to validate LogoutRequest and LogoutResponse using the HTTP-Redirect binding).
# But take in mind that the fingerprint, is a hash, so at the end is open to a collision attack that can end on a signature validation bypass,
# that why we don't recommend it use for production environments.
# (openssl x509 -noout -fingerprint -in "idp.crt" to generate it,
# or add for example the -sha256 , -sha384 or -sha512 parameter)
#
# If a fingerprint is provided, then the certFingerprintAlgorithm is required in order to
# let the toolkit know which Algorithm was used. Possible values: sha1, sha256, sha384 or sha512
# 'sha1' is the default value.
# onelogin.saml2.idp.certfingerprint =
# onelogin.saml2.idp.certfingerprint_algorithm = sha256

# Security settings
#

# Indicates that the nameID of the <samlp:logoutRequest> sent by this SP
# will be encrypted.
onelogin.saml2.security.nameid_encrypted = false

# Indicates whether the <samlp:AuthnRequest> messages sent by this SP
# will be signed.              [The Metadata of the SP will offer this info]
onelogin.saml2.security.authnrequest_signed = false

# Indicates whether the <samlp:logoutRequest> messages sent by this SP
# will be signed.
onelogin.saml2.security.logoutrequest_signed = false

# Indicates whether the <samlp:logoutResponse> messages sent by this SP
# will be signed.
onelogin.saml2.security.logoutresponse_signed = false

# Indicates a requirement for the <samlp:Response>, <samlp:LogoutRequest> and
# <samlp:LogoutResponse> elements received by this SP to be signed.
onelogin.saml2.security.want_messages_signed = false

# Indicates a requirement for the <saml:Assertion> elements received by this SP to be signed.
onelogin.saml2.security.want_assertions_signed = false

# Indicates a requirement for the Metadata of this SP to be signed.
# Right now supported null (in order to not sign) or true (sign using SP private key)
onelogin.saml2.security.sign_metadata =

# Indicates a requirement for the Assertions received by this SP to be encrypted
onelogin.saml2.security.want_assertions_encrypted = false

# Indicates a requirement for the NameID received by this SP to be encrypted
onelogin.saml2.security.want_nameid_encrypted = false


# Authentication context.
# Set Empty and no AuthContext will be sent in the AuthNRequest,
# Set comma separated values urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos,urn:oasis:names:tc:SAML:2.0:ac:classes:Password
onelogin.saml2.security.requested_authncontext = urn:oasis:names:tc:SAML:2.0:ac:classes:Password

# Allows the authn comparison parameter to be set, defaults to 'exact'
onelogin.saml2.security.requested_authncontextcomparison = exact

# Allows duplicated names in the attribute statement
onelogin.saml2.security.allow_duplicated_attribute_name = false

# Indicates if the SP will validate all received xmls.
# (In order to validate the xml, 'strict' and 'wantXMLValidation' must be true).
onelogin.saml2.security.want_xml_validation = true

# Algorithm that the toolkit will use on signing process. Options:
#  'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
#  'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
#  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
#  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'
#  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'
onelogin.saml2.security.signature_algorithm = http://www.w3.org/2001/04/xmldsig-more#rsa-sha256

# Algorithm that the toolkit will use on digest process. Options:
#  'http://www.w3.org/2000/09/xmldsig#sha1'
#  'http://www.w3.org/2001/04/xmlenc#sha256'
#  'http://www.w3.org/2001/04/xmldsig-more#sha384'
#  'http://www.w3.org/2001/04/xmlenc#sha512'
onelogin.saml2.security.digest_algorithm = http://www.w3.org/2001/04/xmlenc#sha256


# Reject Signatures with deprecated algorithms (sha1)
onelogin.saml2.security.reject_deprecated_alg = true

# Enable trimming of parsed Name IDs and attribute values
# SAML specification states that no trimming for string elements should be performed, so no trimming will be
# performed by default on extracted Name IDs and attribute values. However, some SAML implementations may add
# undesirable surrounding whitespace when outputting XML (possibly due to formatting/pretty-printing).
# These two options allow to optionally enable value trimming on extracted Name IDs (including issuers) and
# attribute values.
onelogin.saml2.parsing.trim_name_ids = false
onelogin.saml2.parsing.trim_attribute_values = false

# Prefix used in generated Unique IDs.
# Optional, defaults to ONELOGIN_ or full ID is like ONELOGIN_ebb0badd-4f60-4b38-b20a-a8e01f0592b1.
# At minimun, the prefix can be non-numeric character such as "_".
# onelogin.saml2.unique_id_prefix = _
KeyStores

The Auth constructor supports the ability to read SP public cert/private key from a KeyStore. A KeyStoreSettings object must be provided with the KeyStore, the Alias and the KeyEntry password.

import java.io.FileInputStream;
import java.security.KeyStore;
import com.onelogin.saml2.Auth
import com.onelogin.saml2.model.KeyStoreSettings

String keyStoreFile = "oneloginTestKeystore.jks";
String alias = "keywithpassword";
String storePass = "changeit";
String keyPassword = "keypassword";

KeyStore ks = KeyStore.getInstance("JKS");
ks.load(new FileInputStream(keyStoreFile), storePass.toCharArray());

KeyStoreSettings keyStoreSettings =  new keyStoreSettings(ks, alias, keyPassword);
Auth auth = new Auth(KeyStoreSettings keyStoreSetting);
Dynamic Settings

It is possible to build settings programmatically. You can load your values from different sources such as files, databases, or generated values.

The SettingsBuilder class exposes the method fromValues(Map<String, Object> samlData) which let you build your settings dynamically. The key strings are the same from the Properties file

Map<String, Object> samlData = new HashMap<>();
samlData.put("onelogin.saml2.sp.entityid", "http://localhost:8080/java-saml-tookit-jspsample/metadata.jsp");
samlData.put("onelogin.saml2.sp.assertion_consumer_service.url", new URL("http://localhost:8080/java-saml-tookit-jspsample/acs.jsp"));
samlData.put("onelogin.saml2.security.want_xml_validation",true);
samlData.put("onelogin.saml2.sp.x509cert", myX509CertInstance);

SettingsBuilder builder = new SettingsBuilder();
Saml2Settings settings = builder.fromValues(samlData).build();

To instantiate the Auth class you write

Auth auth = new Auth(settings, request, response);

The HttpRequest

java-saml-core uses HttpRequest class, a framework-agnostic representation of an HTTP request.

java-saml depends on javax.servlet:servlet-api, and the classes Auth and ServletUtils use HttpServletRequest and HttpServletResponse objects.

If you want to use anything different than javax.servlet.http, you will need to reimplement Auth and ServletUtils based on that new representation of the HTTP request/responses.

Initiate SSO

In order to send an AuthNRequest to the IdP:

Auth auth = new Auth(request, response);
auth.login();

The AuthNRequest will be sent signed or unsigned based on the security settings 'onelogin.saml2.security.authnrequest_signed'.

The IdP will then return the SAML Response to the user's client. The client is then forwarded to the Attribute Consumer Service of the SP with this information.

We can set a 'RelayState' parameter containing a return url to the login function:

String returnUrl = 'https://example.com';
auth.login(relayState=returnUrl)

The login method can receive 3 more optional parameters:

  • authnRequestParams which in turn allows to shape the AuthNRequest with the following properties:
    • forceAuthn When true the AuthNRequest will have the ForceAuthn attribute set to true
    • isPassive When true the AuthNRequest will have the IsPassive attribute set to true
    • setNameIdPolicy When true the AuthNRequest will set a NameIdPolicy element
    • allowCreate When true, and setNameIdPolicy is also true, the AuthNRequest will have the AllowCreate attribute set to true on the NameIdPolicy element
    • nameIdValueReq Indicates to the IdP the subject that should be authenticated
  • stay Set to true to stay (returns the url string), otherwise set to false to execute a redirection to that url (IdP SSO URL)
  • parameters Use it to send extra parameters in addition to the AuthNRequest

By default, the login method initiates a redirect to the SAML Identity Provider. You can use the stay parameter, to prevent that, and execute the redirection manually. We need to use that if a match on the future SAMLResponse ID and the AuthNRequest ID to be sent is required. That AuthNRequest ID must be extracted and stored for future validation, so we can't execute the redirection on the login. Instead, set stay to true, then get that ID by

auth.getLastRequestId()

and later executing the redirection manually.

The SP Endpoints

Related to the SP there are 3 important endpoints: The metadata view, the ACS view and the SLS view. The toolkit provides at the demo of the samples folder those views.

SP Metadata

This code will provide the XML metadata file of our SP, based on the info that we provided in the settings files.

Auth auth = new Auth();
Saml2Settings settings = auth.getSettings();
String metadata = settings.getSPMetadata();
List<String> errors = Saml2Settings.validateMetadata(metadata);
if (errors.isEmpty()) {
   out.println(metadata);
} else {
   response.setContentType("text/html; charset=UTF-8");
   for (String error : errors) {
       out.println("<p>"+error+"</p>");
   }
}

The getSPMetadata will return the metadata signed or not based on the security parameter of the settings onelogin.saml2.security.sign_metadata.

Before the XML metadata is exposed, a check takes place to ensure that the info to be provided is valid.

Attribute Consumer Service(ACS)

This code handles the SAML response that the IdP forwards to the SP through the user's client.

Auth auth = new Auth(request, response);
auth.processResponse();
if (!auth.isAuthenticated()) {
   out.println("Not authenticated");
}

List<String> errors = auth.getErrors();
if (!errors.isEmpty()) {
    out.println(StringUtils.join(errors, ", "));
    if (auth.isDebugActive()) {
        String errorReason = auth.getLastErrorReason();
        if (errorReason != null && !errorReason.isEmpty()) {
            out.println(auth.getLastErrorReason());
        }
    }
} else {
    Map<String, List<String>> attributes = auth.getAttributes();
    String nameId = auth.getNameId();
    String nameIdFormat = auth.getNameIdFormat();
    String sessionIndex = auth.getSessionIndex();
    String nameidNameQualifier = auth.getNameIdNameQualifier();
    String nameidSPNameQualifier = auth.getNameIdSPNameQualifier();

    session.setAttribute("attributes", attributes);
    session.setAttribute("nameId", nameId);
    session.setAttribute("nameIdFormat", nameIdFormat);
    session.setAttribute("sessionIndex", sessionIndex);
    session.setAttribute("nameidNameQualifier", nameidNameQualifier);
    session.setAttribute("nameidSPNameQualifier", nameidSPNameQualifier);

    String relayState = request.getParameter("RelayState");

    if (relayState != null && relayState != ServletUtils.getSelfRoutedURLNoQuery(request)) {
        response.sendRedirect(request.getParameter("RelayState"));
    } else {
        if (attributes.isEmpty()) {
            out.println("You don't have any attributes");
        }
       else {
            Collection<String> keys = attributes.keySet();
            for(String name :keys){
                out.println(name);
                List<String> values = attributes.get(name);
                for(String value :values) {
                    out.println(" - " + value);
                }
            }
        }
    }
}

The SAML response is processed and then checked to ensure that there are no errors. It also verifies that the user is authenticated, and then the userdata is stored in the session. At that point there are 2 possible alternatives:

  • If no RelayState is provided, we could show the user data in this view or however we wanted.
  • If RelayState is provided, a redirection take place. Notice that we saved the user data in the session before the redirection to have the user data available at the RelayState view.

In order to retrieve attributes we use:

Map<String, List<String>> attributes = auth.getAttributes();

With this method we get a Map with all the user data provided by the IdP in the Assertion of the SAML Response.

{
    "cn": ["Jhon"],
    "sn": ["Doe"],
    "mail": ["Doe"],
    "groups": ["users", "members"]
}

Each attribute name can be used as a key to obtain the value. Every attribute is a list of values. A single-valued attribute is a list of a single element.

Before trying to get an attribute, check that the user is authenticated. If the user isn't authenticated, an empty Map will be returned. For example, if we call to getAttributes before a auth.processResponse, the getAttributes() will return an empty Map.

Single Logout Service (SLS)

This code handles the Logout Request and the Logout Responses.

Auth auth = new Auth(request, response);
auth.processSLO();
List<String> errors = auth.getErrors();
if (errors.isEmpty()) {
   out.println("Sucessfully logged out");
} else {
   for(String error : errors) {
      out.println(error);
   }
}

If the SLS endpoints receives a Logout Response, the response is validated and the session of the HttpRequest could be closed.

If the SLS endpoints receives an Logout Request, the request is validated, the session is closed and a Logout Response is sent to the SLS endpoint of the IdP.

If we don't want that processSLO to destroy the session, pass the keepLocalSession parameter as true to the processSLO method.

Initiate SLO

In order to send a Logout Request to the IdP:

Auth auth = new Auth(request, response);

String nameId = null;
if (session.getAttribute("nameId") != null) {
    nameId = session.getAttribute("nameId").toString();
}
String nameIdFormat = null;
if (session.getAttribute("nameIdFormat") != null) {
    nameIdFormat = session.getAttribute("nameIdFormat").toString();
}
String nameidNameQualifier = null;
if (session.getAttribute("nameidNameQualifier") != null) {
    nameIdFormat = session.getAttribute("nameidNameQualifier").toString();
}
String nameidSPNameQualifier = null;
if (session.getAttribute("nameidSPNameQualifier") != null) {
    nameidSPNameQualifier = session.getAttribute("nameidSPNameQualifier").toString();
}
String sessionIndex = null;
if (session.getAttribute("sessionIndex") != null) {
    sessionIndex = session.getAttribute("sessionIndex").toString();
}
auth.logout(null, new LogoutRequestParams(sessionIndex, nameId, nameIdFormat));

The Logout Request will be sent signed or unsigned based on the security settings 'onelogin.saml2.security.logoutrequest_signed'

The IdP will return the Logout Response through the user's client to the Single Logout Service of the SP.

We can set a 'RelayState' parameter containing a return url to the login function:

String returnUrl = 'https://example.com';
auth.logout(relayState=returnUrl)

Also there are other 3 optional parameters that can be set:

  • logoutRequestParams which in turn allows to shape the LogoutRequest with the following properties:
    • sessionIndex Identifies the session of the user
    • nameId That will be used to build the LogoutRequest. If no nameId parameter is set and the auth object processed a SAML Response with a NameID, then this NameID will be used
    • nameidFormat The NameID Format that will be set on the LogoutRequest
    • nameIdNameQualifier The NameID NameQualifier that will be set on the LogoutRequest
    • nameIdSPNameQualifier The NameID SPNameQualifier that will be set on the LogoutRequest
  • stay True if we want to stay (returns the url string) False to execute a redirection to that url (IdP SLS URL)
  • parameters Use it to send extra parameters in addition to the LogoutRequest

By default the logout method initiates a redirect to the SAML Identity Provider. You can use the stay parameter, to prevent that, and execute the redirection manually. We need to use that if a match on the future LogoutResponse ID and the LogoutRequest ID to be sent is required, that LogoutRequest ID must be extracted and stored for future validation so we can't execute the redirection on the logout, instead set stay to true, then get that ID by

auth.getLastRequestId()

and later executing the redirection manually.

Extending the provided implementation

All the provided SAML message classes (AuthnRequest, SamlResponse, LogoutRequest, LogoutResponse) can be extended to add or change the processing behavior.

In particular, the classes used to produce outgoing messages (AuthnRequest, LogoutRequest, and LogoutResponse) also provide a postProcessXml method that can be overridden to customise the generation of the corresponding SAML message XML, along with the ability to pass in proper extensions of the input parameter classes (AuthnRequestParams, LogoutRequestParams, and LogoutResponseParams respectively).

Once you have prepared your extension classes, in order to make the Auth class use them, an appropriate SamlMessageFactory implementation can be specified. As an example, assuming you've created two extension classes AuthnRequestEx and SamlResponseEx to customise the creation of AuthnRequest SAML messages and the validation of SAML responses respectively, as well as an extended AuthnRequestParamsEx input parameter class to drive the AuthnRequest generation post-processing, you can do the following:

Auth auth = new Auth(request, response);
auth.setSamlMessageFactory(new SamlMessageFactory() {
	@Override
	public AuthnRequest createAuthnRequest(Saml2Settings settings, AuthnRequestParams params) {
		return new AuthnRequestEx(settings, (AuthnRequestParamsEx) params);
	}

	@Override
	public SamlResponse createSamlResponse(Saml2Settings settings, HttpRequest request) throws Exception {
		return new SamlResponseEx(settings, request);
	}
});
// then proceed with login...
auth.login(relayState, new AuthnRequestParamsEx()); // the custom generation of AuthnReqeustEx will be executed
// ... or process the response as usual
auth.processResponse(); // the custom validation of SamlResponseEx will be executed

Working behind load balancer

Is possible that asserting request URL and Destination attribute of SAML response fails when working behind load balancer with SSL offload.

You should be able to workaround this by configuring your server so that it is aware of the proxy and returns the original url when requested.

For Apache Tomcat this is done by setting the proxyName, proxyPort, scheme and secure attributes for the Connector. See here for an example.

IdP with multiple certificates

In some scenarios the IdP uses different certificates for signing/encryption, or is under key rollover phase and more than one certificate is published on IdP metadata.

In order to handle that the toolkit offers the onelogin.saml2.idp.x509certMulti parameters where you can set additional certificates that will be used to validate IdP signature. However just the certificate set in onelogin.saml2.idp.x509cert parameter will be used for encrypting.

Replay attacks

In order to avoid replay attacks, you can store the ID of the SAML messages already processed, to avoid processing them twice. Since the Messages expires and will be invalidated due that fact, you don't need to store those IDs longer than the time frame that you currently accepting.

Get the ID of the last processed message with the getLastMessageId method of the Auth object.

Demo included in the toolkit

The Java Toolkit allows you to provide the settings in a unique file as described at the Settings section.

SP setup

Configure the SP part and review the metadata of the IdP and complete the IdP info. Later configure how the toolkit will work enabling/disabling the security settings.

IdP setup

Once the SP is configured, the metadata of the SP is published at the /metadata.jsp url. Based on that info, configure the IdP.

How it works

Lets imagine we deploy the jsp example project at http://localhost:8080/java-saml-tookit-jspsample/.

  1. First time you access to the main view http://localhost:8080/java-saml-tookit-jspsample/index.jsp, you can select to login and return to the same view or login and be redirected to the attribute view (attrs).

  2. When you click on a link,:

2.1. In the first link, we are redirected to the /dologin.jsp view. An AuthNRequest is sent to the IdP, we authenticate at the IdP and then a Response is sent to the SP, specifically to the Assertion Consumer Service view: /acs.jsp. There the SAMLResponse is validated, the NameID and user attributes extracted and stored in the session. Notice that a RelayState parameter is set to the url that initiated the process, the dologin.jsp url, but we are not redirecting the user to that view, and instead we present user data on the /acs.jsp view.

2.2. In the second link we are redirected to the /dologin.jsp view with a 'attrs' GET parameter. An AuthNRequest is sent to the IdP with the /attrs.jsp view as RelayState parameter, we authenticate at the IdP and then a Response is sent to the SP, specifically to the Assertion Consumer Service view: /acs.jsp. There the SAMLResponse is validated, the NameID and user attributes extracted and stored in the session and we are redirected to the RelayState view, the attrs.jsp view where user data is read from session and prompted.

  1. The single log out functionality could be tested by 2 ways.

3.1. SLO Initiated by SP. Click on the "logout" link at the SP, after that we are redirected to the /dologout.jsp view where a Logout Request is sent to the IdP, the session at the IdP is closed and replies to the SP a Logout Response (sent to the Single Logout Service endpoint). The SLS endpoint /sls.jsp of the SP process the Logout Response and if is valid, close the user session of the local app. Notice that the SLO Workflow starts and ends at the SP.

3.2. SLO Initiated by IdP. In this case, the action takes place on the IdP side, the logout process is initiated at the IdP, it sends a Logout Request to the SP (SLS endpoint, /sls.jsp). The SLS endpoint of the SP process the Logout Request and if is valid, close the session of the user at the local app and send a Logout Response to the IdP (to the SLS endpoint of the IdP). The IdP receives the Logout Response, process it and close the session at the IdP. Notice that the SLO Workflow starts and ends at the IdP.

java-saml's People

Contributors

aripaawun avatar benmccann avatar bzvestey avatar cgdt avatar chandra158 avatar chenrui333 avatar dependabot[bot] avatar garypwhite avatar gkhaburzaniya-onelogin avatar iguanajazz avatar kemalturksonmez avatar luozhouyang avatar magott avatar maruta-bis5 avatar mauromol avatar mbologna avatar miszobi avatar mwatanabe avatar not-ol-github avatar petenattress avatar pitbulk avatar raosev avatar robertbuttigieg avatar rushimusmaximus avatar sdsolle avatar shoe54 avatar snyk-bot avatar tebruno99 avatar thepetrov avatar tonedef71 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-saml's Issues

NameIdFormat is hardcoded in AuthRequest.java

The NameIdFormat is hardocded currently on line 66 in AuthRequest.java:
writer.writeAttribute("Format", "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified");
If one wants to change it, its necessary to inherit this class and overwrite the method.

2.0 branch status

Hi,

What's the status of the 2.0 branch? It seems that many issues are fixed on that branch, yet still there seems to be no official release, and the README there says not to use it in production.

An update about the status would be appreciated.
Thanks!

Allow retrieving the processed Assertion ID and NotOnOrAfter value

As per SAML profiles spec, section 4.1.4.5:

The service provider MUST ensure that bearer assertions are not replayed, by maintaining the set of used
ID values for the length of time for which the assertion would be considered valid based on the
NotOnOrAfter attribute in the <SubjectConfirmationData>.

To allow the caller to do that, we should allow retrieving the Assertion ID value and the NotOnOrAfter values of the SubjectConfirmationData nodes.

500 error

I have configured the toolkit (deployed on Tomcat) to consume a SAML assertion generated by the CA SiteMInder tool. However, the issue is that though the see on the catalina.log that the SAML is being parsed & displayed in the user readable format with the user details, it errors out in the browser with servlet exceptions on consume.jsp.

Please help

Remove AuthnContextClassRef

The AuthnContextClassRef class doesn't do much but causes many other platforms to stop working. It should be removed or made optional.

SAML responses with a InResponseTo attribute not rejected when requestId not passed to validate()

When validating a SAML response (using SamlResponse#isValid(java.lang.String)), responses that contain a InResponseTo attribute (either as an attribute of the Response, or the SubjectConfirmationData) are not rejected, even when no requestId was specified as an argument to isValid

So a message like

<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="pfx1ff1da4a-010e-428c-16eb-75f31f16567a" Version="2.0" IssueInstant="2014-02-19T01:37:01Z" Destination="http://localhost:8080/java-saml-jspsample/acs.jsp" InResponseTo="ONELOGIN_5fe9d6e499b2f0913206aab3f7191729049bb807">
...
   <saml:Assertion>
...
      <saml:Subject>
         <saml:NameID SPNameQualifier="http://localhost:8080/java-saml-jspsample/metadata.jsp" Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">492882615acf31c8096b627245d76ae53036c090</saml:NameID>
         <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
            <saml:SubjectConfirmationData InResponseTo="ONELOGIN_5fe9d6e499b2f0913206aab3f7191729049bb807" />
         </saml:SubjectConfirmation>
      </saml:Subject>
...
   </saml:Assertion>
</samlp:Response>

will be accepted by SamlResponse#isValid(null). The SAML Core spec (line 1605), and the SAML profiles spec (line 634) say that if the InResponseAttribute is present it MUST match the value of the corresponding request's ID attribute. Further section 4.1.5 of the SAML profiles spec says that an unsolicited response (i.e. IdP initiated), MUST NOT contain a InResposeTo attribute (line 694), so I believe such messages should be rejected as invalid.

Missing deflation

The sample will never work because redirect types need to be deflated before they are base64 and url encoded.

Here's an example of how to deflate the bytes before running them through the.

// Compress the bytes       
        ByteArrayOutputStream deflatedBytes = new ByteArrayOutputStream();
        Deflater deflater = new Deflater(Deflater.DEFLATED, true);
        DeflaterOutputStream deflaterStream = new DeflaterOutputStream(deflatedBytes, deflater);
        deflaterStream.write(baos.toByteArray());
        deflaterStream.finish();

now you can pass deflated bytes to base64 encoding and then url encoding.

Handle encrypted responses

Currently this library won't work with encrypted responses.

Here's some sample code to decrypt SAML responses.

public String getDecryptedAssertion(String privateKey, String encryptedSymKey, String cipherText, String encMethod) throws GeneralSecurityException{

        //Load in the private key
        PrivateKey key = Certificate.loadPrivateKey(privateKey);

        Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-1AndMGF1Padding");

        //Decrypt the key
        cipher.init(Cipher.DECRYPT_MODE, key); //privKey stored earlier
        byte[] symKey = cipher.doFinal( Base64.decodeBase64( encryptedSymKey ) );

        //Get the cipher'd  data base64 decoded
        byte[] cipherBytes = Base64.decodeBase64(cipherText);

        //Get the IV value, which is the first 16 bytes of the cipherBytes
        AlgorithmParameterSpec iv = new IvParameterSpec(cipherBytes, 0, 16);

        //Create a secret key based on symKey
        SecretKeySpec secretSauce = new SecretKeySpec(symKey, "AES");

        String cipherMethod = "";

        //TODO: this should be a switch statement or an enum but Java 1.6 doesn't support string switches
        String[] AES_CBC_PKCS5Padding = {"http://www.w3.org/2001/04/xmlenc#aes128-cbc",
            "http://www.w3.org/2001/04/xmlenc#aes192-cbc",
            "http://www.w3.org/2001/04/xmlenc#aes256-cbc",
            "http://xmlns.webpki.org/keygen2/1.0#algorithm.aes.cbc.pkcs5"};

        String[] AES_CBC_NoPadding = {"internal:AES/CBC/NoPadding"};

        String[] AESWrap = {"http://www.w3.org/2001/04/xmlenc#kw-aes128",
                "http://www.w3.org/2001/04/xmlenc#kw-aes256"};

        String[] AES_ECB_PKCS5Padding = {"http://xmlns.webpki.org/keygen2/1.0#algorithm.aes.ecb.pkcs5"};

        String[] AES_ECB_NoPadding = {"http://xmlns.webpki.org/keygen2/1.0#algorithm.aes.ecb.nopad"};

        if(java.util.Arrays.asList(AES_CBC_PKCS5Padding).indexOf(encMethod) >= 0 ){         
            cipherMethod = "AES/CBC/PKCS5Padding";          
        }else if(java.util.Arrays.asList(AES_CBC_NoPadding).indexOf(encMethod) >= 0){
            cipherMethod = "AES/CBC/NoPadding"; 
        }else if(java.util.Arrays.asList(AESWrap).indexOf(encMethod) >= 0){
            cipherMethod = "AESWrap";   
        }else if(java.util.Arrays.asList(AES_ECB_PKCS5Padding).indexOf(encMethod) >= 0){
            cipherMethod = "AES/ECB/PKCS5Padding";  
        }else if(java.util.Arrays.asList(AES_ECB_NoPadding).indexOf(encMethod) >= 0){
            cipherMethod = "AES/ECB/NoPadding"; 
        }else{      
            cipherMethod = "AES/CBC/PKCS5Padding";  
        }

        //Now we have all the ingredients to decrypt
        cipher = Cipher.getInstance( cipherMethod );
        cipher.init(Cipher.DECRYPT_MODE, secretSauce, iv);

        //Do the decryption
        byte[] decrypedBytes = cipher.doFinal(cipherBytes);

        //Strip off the the first 16 bytes because those are the IV
        return new String( decrypedBytes, 16, decrypedBytes.length-16 );
    }

Invalid date format in authentication request

The current date format in AuthRequest is yyyy-MM-dd'T'H:mm:ss'Z but :

  • There is an H missing
  • This will not generate the right date for servers that are not on the UTC time

Instead I would use this to configure the date format :

SimpleDateFormat simpleDf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
simpleDf.setTimeZone(TimeZone.getTimeZone("GMT"));

Documentation (v2.0.0)

We need to add documentation to the project before release it at Maven.

There are already documentation that already exists at the PHP or Python toolkits.that we can follow as guide.

We need to describe the project scheme, how the settings works, the methods of the main auth class and describe the examples.

In the future we can add examples of how integrate this toolkit on the different Java frameworks.

Description states support for Java6

I was looking at upgrading from the 1.1.2 since I saw the following in the description:

"This is version 2.0.0, compatible with java6 / java7 / java8"

But after importing the projects into eclipse I saw an error that java.util.Objects was not found due to it being part of java7+.

Is there indeed support for java6 or does this warrant a correction in the description?

java-saml core depends on servlet-api, making it less reusable

In v1 java-saml takes care of generating SSO URLs and validating SAMLResponses and leaves it up to the caller to perform the necessary redirects. This makes the library simple and reusable because it has a single responsibility (how to build SSO requests and understand the responses) and does not bring along many other dependencies.

Currently in the v2 branch most classes are now dependent on accessing the HttpServletRequest and HttpServletResponse directly, which means they now have an additional responsibilities like performing redirects, invalidating sessions, etc. The Java ecosystem is much more than just Servlet containers these days but adding this dependency excludes anyone that is not running in a traditional Servlet environment.

To give an example, I have used v1 in a Scala application that does not use a Servlet container and I chose to use the OneLogin toolkit precisely because it did not have unnecessary dependencies (otherwise I would've used Spring Security SAML or OpenSAML directly). I can not use v2 at all currently because I don't have a HttpServletRequest available to pass to the toolkit.

I propose to remove the servlet dependency from the core module, which should only know how to build SSO/SLO requests (independently of the tech stack in use) and understand the responses. At the same time I would add a java-saml-servlet module with a set of "controller" classes that use the core module and call the servlet APIs to perform redirect, etc. By separating the responsibilities of the two modules, the unit tests for each one will become simpler as well.

Thoughts?

License?

There does not appear to be a license associated with the Java code

v2.0.0 Test failures

After checking out v2.0.0, I receive the following. This in on OSX 10.11.6 and Java 8.

$ mvn install -DcreateChecksum=true
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.onelogin:java-saml-core:jar:2.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ com.onelogin:java-saml-core:[unknown-version], /Users/tcaraballo/src/java-saml/core/pom.xml, line 90, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] OneLogin java-saml Toolkit Project
[INFO] OneLogin java-saml Toolkit Core
[INFO] OneLogin java-saml Toolkit
[INFO] OneLogin java-saml Toolkit Samples
[INFO] OneLogin java-saml Toolkit Sample Webapp
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building OneLogin java-saml Toolkit Project 2.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-versions) @ java-saml-toolkit ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ java-saml-toolkit ---
[INFO] Installing /Users/tcaraballo/src/java-saml/pom.xml to /Users/tcaraballo/.m2/repository/com/onelogin/java-saml-toolkit/2.0.0-SNAPSHOT/java-saml-toolkit-2.0.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building OneLogin java-saml Toolkit Core 2.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-versions) @ java-saml-core ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent (prepare-agent) @ java-saml-core ---
[INFO] jacoco.agent.argLine set to -javaagent:/Users/tcaraballo/.m2/repository/org/jacoco/org.jacoco.agent/0.7.7.201606060606/org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=/Users/tcaraballo/src/java-saml/core/target/jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ java-saml-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 12 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ java-saml-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /Users/tcaraballo/src/java-saml/core/target/classes
[INFO] /Users/tcaraballo/src/java-saml/core/src/main/java/com/onelogin/saml2/authn/SamlResponse.java: /Users/tcaraballo/src/java-saml/core/src/main/java/com/onelogin/saml2/authn/SamlResponse.java uses or overrides a deprecated API.
[INFO] /Users/tcaraballo/src/java-saml/core/src/main/java/com/onelogin/saml2/authn/SamlResponse.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ java-saml-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 145 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ java-saml-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 12 source files to /Users/tcaraballo/src/java-saml/core/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12:test (default-test) @ java-saml-core ---
[INFO] Surefire report directory: /Users/tcaraballo/src/java-saml/core/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
objc[19732]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Running com.onelogin.saml2.http.HttpRequestTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.182 sec
Running com.onelogin.saml2.test.authn.AuthnRequestTest
11:19:57,214 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
11:19:57,214 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [file:/Users/tcaraballo/src/java-saml/core/target/test-classes/logback-test.xml]
11:19:57,404 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
11:19:57,408 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
11:19:57,427 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
11:19:57,572 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
11:19:57,572 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
11:19:57,572 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
11:19:57,573 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.base22] to TRACE
11:19:57,573 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
11:19:57,573 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
11:19:57,574 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
11:19:57,577 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@6145b81e - Registering current configuration as safe fallback point

Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.852 sec
Running com.onelogin.saml2.test.authn.AuthnResponseTest
11:19:58.073 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:19:58.284 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Invalid issuer in the Assertion/Response
11:19:58.295 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:19:58.357 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Invalid issuer in the Assertion/Response
11:19:58.443 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:19:58.490 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response
11:19:58.501 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:19:58.561 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response
11:19:58.800 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The Response has an InResponseTo attribute: ONELOGIN_5fe9d6e499b2f0913206aab3f7191729049bb807 while no InResponseTo was expected
11:20:01.833 [main] ERROR c.onelogin.saml2.authn.SamlResponse - SAML Response must contain 1 Assertion.
11:20:01.837 [main] ERROR c.onelogin.saml2.authn.SamlResponse - SAML Response must contain 1 Assertion.
11:20:01.946 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The InResponseTo of the Response: null, does not match the ID of the AuthNRequest sent by the SP: expected-id
11:20:01.993 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.027 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response: SubjectConfirmationData doesn't match a valid Recipient
11:20:02.032 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.059 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The response was received at / instead of http://localhost:8080/java-saml-jspsample/acs.jsp
11:20:02.090 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.098 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.125 [main] ERROR c.onelogin.saml2.authn.SamlResponse - http://localhost:8080/java-saml-jspsample/metadata.jsp is not a valid audience for this Response
[Fatal Error] :1:1: Content is not allowed in prolog.
11:20:02.160 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Invalid Signature Element {urn:oasis:names:tc:SAML:2.0:assertion}Response SAML Response rejected
11:20:02.168 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Missing ID attribute on SAML Response.
11:20:02.460 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The Assertion of the Response is not signed and the SP requires it
11:20:02.634 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The Assertion must include an AuthnStatement element
11:20:02.691 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response: SubjectConfirmationData has an invalid InResponseTo value
11:20:02.723 [main] ERROR c.onelogin.saml2.authn.SamlResponse - SAML Response must contain 1 Assertion.
11:20:02.754 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.778 [main] ERROR c.onelogin.saml2.authn.SamlResponse - There is an EncryptedAttribute in the Response and this SP not support them
11:20:02.792 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.795 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.802 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.807 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.831 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.861 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The Assertion of the Response is not signed and the SP requires it
11:20:02.890 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The Message of the Response is not signed and the SP requires it
11:20:02.919 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The Assertion of the Response is not signed and the SP requires it
11:20:02.926 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.929 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.933 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.944 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:02.980 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:03.036 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The assertion of the Response is not encrypted and the SP requires it
11:20:03.066 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The NameID of the Response is not encrypted and the SP requires it
11:20:03.084 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The assertion of the Response is not encrypted and the SP requires it
11:20:03.347 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The InResponseTo of the Response: ONELOGIN_5fe9d6e499b2f0913206aab3f7191729049bb807, does not match the ID of the AuthNRequest sent by the SP: invalidRequestId
11:20:03.507 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The Message of the Response is not signed and the SP requires it
11:20:03.533 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Timing issues (please check your clock settings)
11:20:03.612 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:03.635 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response: SubjectConfirmationData is not yet valid
11:20:03.656 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Unsupported SAML Version.
11:20:03.676 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Signature validation failed. SAML Response rejected
11:20:03.883 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The Assertion must include a Conditions element
11:20:03.920 [main] ERROR c.onelogin.saml2.authn.SamlResponse - http://localhost:8080/java-saml-jspsample/metadata.jsp is not a valid audience for this Response
11:20:03.941 [main] WARN  com.onelogin.saml2.util.Util - Errors found when validating SAML response with schema: [org.xml.sax.SAXParseException; cvc-complex-type.2.4.a: Invalid content was found starting with element 'saml:Issuer'. One of '{"urn:oasis:names:tc:SAML:2.0:protocol":Extensions, "urn:oasis:names:tc:SAML:2.0:protocol":Status}' is expected.]
11:20:03.943 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd
11:20:03.970 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The response has an empty Destination value
11:20:03.993 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:04.019 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:04.103 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:04.119 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response: SubjectConfirmationData has an invalid InResponseTo value
11:20:04.172 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Found an invalid Signed Element. SAML Response rejected
11:20:04.177 [main] ERROR c.onelogin.saml2.authn.SamlResponse - SAML Response must contain 1 Assertion.
11:20:04.184 [main] ERROR c.onelogin.saml2.authn.SamlResponse - SAML Response must contain 1 Assertion.
11:20:04.232 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response: SubjectConfirmationData doesn't contain a NotOnOrAfter attribute
11:20:04.238 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:04.259 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response
11:20:04.273 [main] ERROR c.onelogin.saml2.authn.SamlResponse - SAML Response must contain 1 Assertion.
11:20:04.322 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response:
[0] SubjectConfirmationData doesn't contain a NotOnOrAfter attribute,
[1] SubjectConfirmationData doesn't contain a Recipient,
[2] SubjectConfirmationData is no longer valid
11:20:04.418 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The URL of the current host was not established
11:20:04.418 [main] ERROR c.onelogin.saml2.authn.SamlResponse - The URL of the current host was not established
11:20:04.469 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response: SubjectConfirmationData doesn't contain a Recipient
11:20:04.575 [main] ERROR c.o.saml2.settings.SettingsBuilder - Error loading certificate from properties.
java.security.cert.CertificateException: Unable to initialize, java.io.IOException: extra data given to DerValue constructor
	at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:198) ~[na:1.8.0_45]
	at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:100) ~[na:1.8.0_45]
	at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339) ~[na:1.8.0_45]
	at com.onelogin.saml2.util.Util.loadCert(Util.java:447) ~[classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.loadCertificateFromProp(SettingsBuilder.java:476) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.loadIdpSetting(SettingsBuilder.java:210) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.build(SettingsBuilder.java:171) [classes/:na]
	at com.onelogin.saml2.test.authn.AuthnResponseTest.testIsInValidCert(AuthnResponseTest.java:1635) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Caused by: java.io.IOException: extra data given to DerValue constructor
	at sun.security.util.DerValue.init(DerValue.java:384) ~[na:1.8.0_45]
	at sun.security.util.DerValue.<init>(DerValue.java:294) ~[na:1.8.0_45]
	at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:195) ~[na:1.8.0_45]
	... 36 common frames omitted
11:20:04.582 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Signature validation failed. SAML Response rejected
11:20:04.606 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:04.613 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Duplicated ID. SAML Response rejected
11:20:04.620 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Duplicated ID. SAML Response rejected
11:20:04.626 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Duplicated ID. SAML Response rejected
11:20:04.630 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Invalid Signature Element {urn:oasis:names:tc:SAML:2.0:assertion}Subject SAML Response rejected
11:20:04.635 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Invalid Signature Element {urn:oasis:names:tc:SAML:2.0:assertion}Subject SAML Response rejected
11:20:04.640 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Found an invalid Signed Element. SAML Response rejected
11:20:04.644 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Signed Element must contain an ID. SAML Response rejected
11:20:04.649 [main] ERROR c.onelogin.saml2.authn.SamlResponse - Found an invalid Signed Element. SAML Response rejected
11:20:04.693 [main] ERROR c.onelogin.saml2.authn.SamlResponse - No Signature found. SAML Response rejected
11:20:04.728 [main] ERROR c.onelogin.saml2.authn.SamlResponse - A valid SubjectConfirmation was not found on this Response: SubjectConfirmationData is no longer valid
11:20:04.840 [main] ERROR c.onelogin.saml2.authn.SamlResponse - SAML Response is not loaded
Tests run: 94, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.898 sec <<< FAILURE!
Running com.onelogin.saml2.test.logout.LogoutRequestTest
11:20:04.889 [main] ERROR c.o.saml2.logout.LogoutRequest - The LogoutRequest was received at / instead of http://stuff.com/endpoints/endpoints/sls.php
11:20:04.897 [main] ERROR c.o.saml2.logout.LogoutRequest - The HttpRequest of the current host was not established
11:20:04.900 [main] ERROR c.o.saml2.logout.LogoutRequest - The URL of the current host was not established
[Fatal Error] :1:1: Premature end of file.
11:20:05.062 [main] ERROR c.o.saml2.logout.LogoutRequest - Timing issues (please check your clock settings)
11:20:05.102 [main] ERROR c.o.saml2.logout.LogoutRequest - The LogoutRequest was received at / instead of http://stuff.com/endpoints/endpoints/sls.php
11:20:05.149 [main] ERROR c.o.saml2.logout.LogoutRequest - Invalid issuer in the Logout Request
11:20:05.204 [main] WARN  com.onelogin.saml2.util.Util - Errors found when validating SAML response with schema: [org.xml.sax.SAXParseException; cvc-complex-type.2.4.a: Invalid content was found starting with element 'saml:Issuer'. One of '{"http://www.w3.org/2000/09/xmldsig#":Signature, "urn:oasis:names:tc:SAML:2.0:protocol":Extensions, "urn:oasis:names:tc:SAML:2.0:assertion":BaseID, "urn:oasis:names:tc:SAML:2.0:assertion":NameID, "urn:oasis:names:tc:SAML:2.0:assertion":EncryptedID}' is expected.]
11:20:05.205 [main] ERROR c.o.saml2.logout.LogoutRequest - Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd
11:20:05.317 [main] ERROR c.o.saml2.logout.LogoutRequest - Signature validation failed. Logout Request rejected
11:20:05.339 [main] ERROR c.o.saml2.logout.LogoutRequest - The Message of the Logout Request is not signed and the SP requires it
11:20:05.359 [main] ERROR c.o.saml2.logout.LogoutRequest - In order to validate the sign on the Logout Request, the x509cert of the IdP is required
11:20:05.385 [main] ERROR c.o.saml2.logout.LogoutRequest - The LogoutRequest was received at / instead of http://stuff.com/endpoints/endpoints/sls.php
[Fatal Error] :1:1: Premature end of file.
11:20:05.420 [main] ERROR c.o.saml2.logout.LogoutRequest - SAML Logout Request is not loaded
Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.575 sec
Running com.onelogin.saml2.test.logout.LogoutResponseTest
11:20:05.453 [main] ERROR c.o.saml2.logout.LogoutResponse - Invalid issuer in the Logout Response
11:20:05.472 [main] ERROR c.o.saml2.logout.LogoutResponse - The LogoutResponse was received at / instead of http://stuff.com/endpoints/endpoints/sls.php
11:20:05.476 [main] ERROR c.o.saml2.logout.LogoutResponse - SAML Logout Response is not loaded
11:20:05.496 [main] ERROR c.o.saml2.logout.LogoutResponse - The LogoutResponse was received at / instead of http://stuff.com/endpoints/endpoints/sls.php
11:20:05.545 [main] ERROR c.o.saml2.logout.LogoutResponse - The InResponseTo of the Logout Response: ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e, does not match the ID of the Logout request sent by the SP:: invalid_request_id
11:20:05.569 [main] WARN  com.onelogin.saml2.util.Util - Errors found when validating SAML response with schema: [org.xml.sax.SAXParseException; cvc-complex-type.2.4.a: Invalid content was found starting with element 'saml:Issuer'. One of '{"http://www.w3.org/2000/09/xmldsig#":Signature, "urn:oasis:names:tc:SAML:2.0:protocol":Extensions, "urn:oasis:names:tc:SAML:2.0:protocol":Status}' is expected.]
11:20:05.570 [main] ERROR c.o.saml2.logout.LogoutResponse - Invalid SAML Logout Response. Not match the saml-schema-protocol-2.0.xsd
11:20:05.577 [main] ERROR c.o.saml2.logout.LogoutResponse - SAML Logout Response is not loaded
11:20:05.577 [main] ERROR c.o.saml2.logout.LogoutResponse - SAML Logout Response is not loaded
11:20:05.587 [main] ERROR c.o.saml2.logout.LogoutResponse - SAML Logout Response is not loaded
11:20:05.610 [main] ERROR c.o.saml2.logout.LogoutResponse - Signature validation failed. Logout Response rejected
11:20:05.629 [main] ERROR c.o.saml2.logout.LogoutResponse - The Message of the Logout Response is not signed and the SP requires it
11:20:05.645 [main] ERROR c.o.saml2.logout.LogoutResponse - In order to validate the sign on the Logout Response, the x509cert of the IdP is required
11:20:05.661 [main] ERROR c.o.saml2.logout.LogoutResponse - The LogoutResponse was received at / instead of http://stuff.com/endpoints/endpoints/sls.php
Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.261 sec
Running com.onelogin.saml2.test.model.ContactTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Running com.onelogin.saml2.test.model.OrganizationTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
Running com.onelogin.saml2.test.model.SamlResponseStatusTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec
Running com.onelogin.saml2.test.settings.MetadataTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.075 sec
Running com.onelogin.saml2.test.settings.Saml2SettingsTest
11:20:05.909 [main] ERROR c.o.saml2.settings.SettingsBuilder - Error loading certificate from properties.
java.security.cert.CertificateException: Unable to initialize, java.io.IOException: extra data given to DerValue constructor
	at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:198) ~[na:1.8.0_45]
	at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:100) ~[na:1.8.0_45]
	at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339) ~[na:1.8.0_45]
	at com.onelogin.saml2.util.Util.loadCert(Util.java:447) ~[classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.loadCertificateFromProp(SettingsBuilder.java:476) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.loadIdpSetting(SettingsBuilder.java:210) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.build(SettingsBuilder.java:171) [classes/:na]
	at com.onelogin.saml2.test.settings.Saml2SettingsTest.testCheckSPSettingsAllErrors(Saml2SettingsTest.java:107) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Caused by: java.io.IOException: extra data given to DerValue constructor
	at sun.security.util.DerValue.init(DerValue.java:384) ~[na:1.8.0_45]
	at sun.security.util.DerValue.<init>(DerValue.java:294) ~[na:1.8.0_45]
	at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:195) ~[na:1.8.0_45]
	... 36 common frames omitted
11:20:05.910 [main] ERROR c.o.saml2.settings.Saml2Settings - sp_entityId_not_found
11:20:05.911 [main] ERROR c.o.saml2.settings.Saml2Settings - sp_acs_not_found
11:20:05.911 [main] ERROR c.o.saml2.settings.Saml2Settings - sp_cert_not_found_and_required
11:20:05.975 [main] ERROR c.o.saml2.settings.Saml2Settings - contact_not_enought_data
11:20:05.977 [main] ERROR c.o.saml2.settings.Saml2Settings - organization_not_enought_data
11:20:06.016 [main] ERROR c.o.saml2.settings.Saml2Settings - idp_entityId_not_found
11:20:06.016 [main] ERROR c.o.saml2.settings.Saml2Settings - idp_sso_url_invalid
11:20:06.016 [main] ERROR c.o.saml2.settings.Saml2Settings - idp_cert_or_fingerprint_not_found_and_required
11:20:06.016 [main] ERROR c.o.saml2.settings.Saml2Settings - idp_cert_not_found_and_required
11:20:06.111 [main] WARN  com.onelogin.saml2.util.Util - Errors found when validating SAML response with schema: [org.xml.sax.SAXParseException; cvc-elt.1: Cannot find the declaration of element 'md:EntityDescriptor2'.]
11:20:06.113 [main] ERROR c.o.saml2.settings.Saml2Settings - sp_entityId_not_found
11:20:06.113 [main] ERROR c.o.saml2.settings.Saml2Settings - sp_acs_not_found
11:20:06.113 [main] ERROR c.o.saml2.settings.Saml2Settings - sp_cert_not_found_and_required
11:20:06.113 [main] ERROR c.o.saml2.settings.Saml2Settings - contact_not_enought_data
11:20:06.113 [main] ERROR c.o.saml2.settings.Saml2Settings - organization_not_enought_data
11:20:06.114 [main] ERROR c.o.saml2.settings.Saml2Settings - idp_entityId_not_found
11:20:06.114 [main] ERROR c.o.saml2.settings.Saml2Settings - idp_sso_url_invalid
11:20:06.114 [main] ERROR c.o.saml2.settings.Saml2Settings - idp_cert_or_fingerprint_not_found_and_required
11:20:06.114 [main] ERROR c.o.saml2.settings.Saml2Settings - idp_cert_not_found_and_required
Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.316 sec
Running com.onelogin.saml2.test.settings.SettingBuilderTest
11:20:06.139 [main] ERROR c.o.saml2.settings.SettingsBuilder - Error loading privatekey from properties.
java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: IOException : Detect premature EOF
	at sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(RSAKeyFactory.java:217) ~[na:1.8.0_45]
	at java.security.KeyFactory.generatePrivate(KeyFactory.java:372) ~[na:1.8.0_45]
	at com.onelogin.saml2.util.Util.loadPrivateKey(Util.java:477) ~[classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.loadPrivateKeyFromProp(SettingsBuilder.java:537) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.loadSpSetting(SettingsBuilder.java:378) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.build(SettingsBuilder.java:170) [classes/:na]
	at com.onelogin.saml2.test.settings.SettingBuilderTest.testLoadFromFileInvalidSPCerts(SettingBuilderTest.java:349) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Caused by: java.security.InvalidKeyException: IOException : Detect premature EOF
	at sun.security.pkcs.PKCS8Key.decode(PKCS8Key.java:351) ~[na:1.8.0_45]
	at sun.security.pkcs.PKCS8Key.decode(PKCS8Key.java:356) ~[na:1.8.0_45]
	at sun.security.rsa.RSAPrivateCrtKeyImpl.<init>(RSAPrivateCrtKeyImpl.java:91) ~[na:1.8.0_45]
	at sun.security.rsa.RSAPrivateCrtKeyImpl.newKey(RSAPrivateCrtKeyImpl.java:75) ~[na:1.8.0_45]
	at sun.security.rsa.RSAKeyFactory.generatePrivate(RSAKeyFactory.java:316) ~[na:1.8.0_45]
	at sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(RSAKeyFactory.java:213) ~[na:1.8.0_45]
	... 35 common frames omitted
11:20:06.146 [main] ERROR c.o.saml2.settings.SettingsBuilder - 'onelogin.saml2.idp.single_logout_service.url' contains malformed url.
java.net.MalformedURLException: no protocol: invalid_slo_url
	at java.net.URL.<init>(URL.java:586) ~[na:1.8.0_45]
	at java.net.URL.<init>(URL.java:483) ~[na:1.8.0_45]
	at java.net.URL.<init>(URL.java:432) ~[na:1.8.0_45]
	at com.onelogin.saml2.settings.SettingsBuilder.loadURLProperty(SettingsBuilder.java:453) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.loadIdpSetting(SettingsBuilder.java:198) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.build(SettingsBuilder.java:171) [classes/:na]
	at com.onelogin.saml2.test.settings.SettingBuilderTest.testLoadFromFileDifferentProp(SettingBuilderTest.java:446) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
11:20:06.147 [main] ERROR c.o.saml2.settings.SettingsBuilder - 'onelogin.saml2.idp.single_logout_service.response.url' contains malformed url.
java.net.MalformedURLException: no protocol: invalid_slo_response_url
	at java.net.URL.<init>(URL.java:586) ~[na:1.8.0_45]
	at java.net.URL.<init>(URL.java:483) ~[na:1.8.0_45]
	at java.net.URL.<init>(URL.java:432) ~[na:1.8.0_45]
	at com.onelogin.saml2.settings.SettingsBuilder.loadURLProperty(SettingsBuilder.java:453) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.loadIdpSetting(SettingsBuilder.java:202) [classes/:na]
	at com.onelogin.saml2.settings.SettingsBuilder.build(SettingsBuilder.java:171) [classes/:na]
	at com.onelogin.saml2.test.settings.SettingBuilderTest.testLoadFromFileDifferentProp(SettingBuilderTest.java:446) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.042 sec
Running com.onelogin.saml2.test.util.UtilsTest
[Fatal Error] :1:31: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.
11:20:06.193 [main] ERROR com.onelogin.saml2.util.Util - Error executing generateNameId: null
java.lang.NullPointerException: null
	at org.apache.xml.security.c14n.implementations.CanonicalizerBase.outputTextToWriter(CanonicalizerBase.java:842) ~[xmlsec-2.0.7.jar:2.0.7]
	at org.apache.xml.security.c14n.implementations.CanonicalizerBase.canonicalizeSubTree(CanonicalizerBase.java:277) ~[xmlsec-2.0.7.jar:2.0.7]
	at org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCanonicalizeSubTree(CanonicalizerBase.java:197) ~[xmlsec-2.0.7.jar:2.0.7]
	at org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCanonicalizeSubTree(CanonicalizerBase.java:117) ~[xmlsec-2.0.7.jar:2.0.7]
	at org.apache.xml.security.c14n.Canonicalizer.canonicalizeSubtree(Canonicalizer.java:303) ~[xmlsec-2.0.7.jar:2.0.7]
	at org.apache.xml.security.utils.XMLUtils.outputDOM(XMLUtils.java:230) ~[xmlsec-2.0.7.jar:2.0.7]
	at org.apache.xml.security.utils.XMLUtils.outputDOM(XMLUtils.java:212) ~[xmlsec-2.0.7.jar:2.0.7]
	at com.onelogin.saml2.util.Util.convertDocumentToString(Util.java:327) [classes/:na]
	at com.onelogin.saml2.util.Util.convertDocumentToString(Util.java:341) [classes/:na]
	at com.onelogin.saml2.util.Util.generateNameId(Util.java:1178) [classes/:na]
	at com.onelogin.saml2.util.Util.generateNameId(Util.java:1199) [classes/:na]
	at com.onelogin.saml2.test.util.UtilsTest.testGenerateNameIdException(UtilsTest.java:1671) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
11:20:06.201 [main] ERROR o.a.x.security.encryption.XMLCipher - XMLCipher::decryptElement called without a key and unable to resolve
[Fatal Error] :1:24: XML document structures must start and end within the same entity.
[Fatal Error] :1:24: XML document structures must start and end within the same entity.
11:20:06.206 [main] WARN  com.onelogin.saml2.util.Util - Error executing validateXML: xmlDocument was null
java.lang.IllegalArgumentException: xmlDocument was null
	at com.onelogin.saml2.util.Util.validateXML(Util.java:213) ~[classes/:na]
	at com.onelogin.saml2.test.util.UtilsTest.testValidateXMLBadFormat(UtilsTest.java:163) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
[Fatal Error] :14:22: The end-tag for element type "md:EntityDescriptor" must end with a '>' delimiter.
11:20:06.325 [main] WARN  com.onelogin.saml2.util.Util - Error executing validateXML: xmlDocument was null
java.lang.IllegalArgumentException: xmlDocument was null
	at com.onelogin.saml2.util.Util.validateXML(Util.java:213) ~[classes/:na]
	at com.onelogin.saml2.test.util.UtilsTest.testValidateXMLInvalid(UtilsTest.java:196) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
11:20:06.420 [main] WARN  com.onelogin.saml2.util.Util - Errors found when validating SAML response with schema: [org.xml.sax.SAXParseException; cvc-complex-type.2.4.a: Invalid content was found starting with element 'md:SingleLogoutService'. One of '{"urn:oasis:names:tc:SAML:2.0:metadata":AssertionConsumerService, "urn:oasis:names:tc:SAML:2.0:metadata":AttributeConsumingService}' is expected.]
11:20:06.773 [main] WARN  com.onelogin.saml2.util.Util - Errors found when validating SAML response with schema: [org.xml.sax.SAXParseException; cvc-elt.1: Cannot find the declaration of element 'md:EntityDescriptor2'.]
11:20:06.835 [main] WARN  com.onelogin.saml2.util.Util - Errors found when validating SAML response with schema: [org.xml.sax.SAXParseException; cvc-elt.1: Cannot find the declaration of element 'md:EntityDescriptor'.]
11:20:06.870 [main] WARN  com.onelogin.saml2.util.Util - Failed to find signature nodes
javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:287) ~[na:1.8.0_45]
	at com.onelogin.saml2.util.Util.query(Util.java:174) ~[classes/:na]
	at com.onelogin.saml2.util.Util.query(Util.java:194) ~[classes/:na]
	at com.onelogin.saml2.util.Util.validateSign(Util.java:800) ~[classes/:na]
	at com.onelogin.saml2.test.util.UtilsTest.testValidateSignInvalidsInputs(UtilsTest.java:930) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Caused by: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:368) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:211) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:273) ~[na:1.8.0_45]
	... 33 common frames omitted
Caused by: java.lang.RuntimeException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.axes.NodeSequence.setRoot(NodeSequence.java:266) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.axes.LocPathIterator.execute(LocPathIterator.java:214) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:339) ~[na:1.8.0_45]
	... 35 common frames omitted
11:20:06.872 [main] WARN  com.onelogin.saml2.util.Util - Failed to find signature nodes
javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:287) ~[na:1.8.0_45]
	at com.onelogin.saml2.util.Util.query(Util.java:174) ~[classes/:na]
	at com.onelogin.saml2.util.Util.query(Util.java:194) ~[classes/:na]
	at com.onelogin.saml2.util.Util.validateSign(Util.java:800) ~[classes/:na]
	at com.onelogin.saml2.test.util.UtilsTest.testValidateSignInvalidsInputs(UtilsTest.java:931) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Caused by: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:368) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:211) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:273) ~[na:1.8.0_45]
	... 33 common frames omitted
Caused by: java.lang.RuntimeException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.axes.NodeSequence.setRoot(NodeSequence.java:266) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.axes.LocPathIterator.execute(LocPathIterator.java:214) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:339) ~[na:1.8.0_45]
	... 35 common frames omitted
11:20:06.875 [main] WARN  com.onelogin.saml2.util.Util - Failed to find signature nodes
javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:287) ~[na:1.8.0_45]
	at com.onelogin.saml2.util.Util.query(Util.java:174) ~[classes/:na]
	at com.onelogin.saml2.util.Util.query(Util.java:194) ~[classes/:na]
	at com.onelogin.saml2.util.Util.validateSign(Util.java:800) ~[classes/:na]
	at com.onelogin.saml2.test.util.UtilsTest.testValidateSignInvalidsInputs(UtilsTest.java:932) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Caused by: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:368) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:211) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:273) ~[na:1.8.0_45]
	... 33 common frames omitted
Caused by: java.lang.RuntimeException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.axes.NodeSequence.setRoot(NodeSequence.java:266) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.axes.LocPathIterator.execute(LocPathIterator.java:214) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:339) ~[na:1.8.0_45]
	... 35 common frames omitted
11:20:06.882 [main] WARN  com.onelogin.saml2.util.Util - Failed to find signature nodes
javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:287) ~[na:1.8.0_45]
	at com.onelogin.saml2.util.Util.query(Util.java:174) ~[classes/:na]
	at com.onelogin.saml2.util.Util.query(Util.java:194) ~[classes/:na]
	at com.onelogin.saml2.util.Util.validateSign(Util.java:800) ~[classes/:na]
	at com.onelogin.saml2.test.util.UtilsTest.testValidateSignInvalidsInputs(UtilsTest.java:933) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Caused by: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:368) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:211) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:273) ~[na:1.8.0_45]
	... 33 common frames omitted
Caused by: java.lang.RuntimeException: Unable to evaluate expression using this context
	at com.sun.org.apache.xpath.internal.axes.NodeSequence.setRoot(NodeSequence.java:266) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.axes.LocPathIterator.execute(LocPathIterator.java:214) ~[na:1.8.0_45]
	at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:339) ~[na:1.8.0_45]
	... 35 common frames omitted
11:20:06.886 [main] WARN  o.a.x.s.signature.XMLSignature - Signature verification failed.
11:20:06.888 [main] WARN  o.a.x.s.signature.XMLSignature - Signature verification failed.
11:20:06.905 [main] WARN  o.a.xml.security.signature.Reference - Verification failed for URI "#pfxf94cd805-c22b-8198-6eff-194096928ec5"
11:20:06.905 [main] WARN  o.a.xml.security.signature.Reference - Expected Digest: xarsZtmYNTXSrLhO/kzu1sAs268=
11:20:06.905 [main] WARN  o.a.xml.security.signature.Reference - Actual Digest: efuCqgAdannb2aDrPpRzXNjeeSM=
11:20:06.909 [main] WARN  o.a.xml.security.signature.Reference - Verification failed for URI "#pfxf94cd805-c22b-8198-6eff-194096928ec5"
11:20:06.909 [main] WARN  o.a.xml.security.signature.Reference - Expected Digest: xarsZtmYNTXSrLhO/kzu1sAs268=
11:20:06.910 [main] WARN  o.a.xml.security.signature.Reference - Actual Digest: efuCqgAdannb2aDrPpRzXNjeeSM=
[Fatal Error] :14:22: The end-tag for element type "md:EntityDescriptor" must end with a '>' delimiter.
11:20:06.991 [main] ERROR o.a.x.security.encryption.XMLCipher - XMLCipher::decryptElement called without a key and unable to resolve
Tests run: 68, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.834 sec

Results :

Tests in error:
  testEncryptedResponse(com.onelogin.saml2.test.authn.AuthnResponseTest)

Tests run: 254, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] OneLogin java-saml Toolkit Project ................. SUCCESS [  1.322 s]
[INFO] OneLogin java-saml Toolkit Core .................... FAILURE [ 17.005 s]
[INFO] OneLogin java-saml Toolkit ......................... SKIPPED
[INFO] OneLogin java-saml Toolkit Samples ................. SKIPPED
[INFO] OneLogin java-saml Toolkit Sample Webapp ........... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.486 s
[INFO] Finished at: 2016-11-15T11:20:07-05:00
[INFO] Final Memory: 23M/315M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project java-saml-core: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/tcaraballo/src/java-saml/core/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :java-saml-core

Missing dependency information

How is this project supposed to be setup? I see no project setup files. One would expect a pom.xml or build.gradle or at least build.xml...

com.onelogin.saml.Utils.validateXML fails with NullPointerException on Windows

The following exception is thrown by consume.jsp when processing a SAML response.

java.lang.NullPointerException
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:670)
at com.onelogin.saml.Utils.validateXML(Utils.java:244)
at com.onelogin.saml.Utils.validateXML(Utils.java:223)
at com.onelogin.saml.Response.isValid(Response.java:126)
at org.apache.jsp.sso.acs_jsp._jspService(acs_jsp.java:105)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
....

Details of my environment:
Windows 7 / Java 1.8.0_51

Preliminary debugging reveals that the problem is with com.onelogin.saml.Utils.validateXML(Utils.java:239) which constructs
String schemaFullPath = "schemas" + File.separatorChar + schemaName;

On Windows File.separatorChar is a backslash, which leads to failure in:
URL schemaFile = classLoader.getResource(schemaFullPath);

Using a forward slash (/) separator seems to fix the problem.

Publish to Maven Central

It would be easier to integrate into our product if the library were published to Maven Central. This would also solve other problems such as automatically pulling in the required dependencies such as Apache Commons Codec and whatever else is needed.

jacoco // coveralls not working.

It seems that on java 1.8 jacoco // coveralls fail.

mvn -v
Apache Maven 3.2.5
Java version: 1.8.0_91, vendor: Oracle Corporation

mvn clean test jacoco:report coveralls:report

No plugin found for prefix 'jacoco' in the current project and in the plugin groups
[org.apache.maven.plugins, org.codehaus.mojo] available from the repositories
[local (/home/xxx/.m2/repository), central (https://repo.maven.apache.org/maven2)]

No plugin found for prefix 'coveralls' in the current project and in the plugin groups
[org.apache.maven.plugins, org.codehaus.mojo] available from the repositories
[local (/home/xxx/.m2/repository), central (https://repo.maven.apache.org/maven2)]

Issues with PowerMock

This toolkit uses PowerMock in order to test its methods.

There are some problems with PowerMock described in the documentation.

We should find a way to fix those problems. Right now it seems is not possible to execute test on Java8 (Java7 requires a extra command to disable the bytecode verification.

Make com.onelogin.saml2.Auth more extensible.

I think it would be be helpful to make the library more extensible by adding a few methods and making some of the private fields protected.

For com.onelogin.saml2.settings.SettingsBuilder it would be nice to be to have a constructor that took Saml2Settings. This would allow me to load the settings dynamically externally but still use the existing validation code provided by the SettingsBuilder.

Also I have extended the com.onelogin.saml2.Auth and I am adding a overloading Auth.processResponse() -> Auth.processResponse(HttpRequest httpRequest). It would be helpful if some of the properties were made to be protected. Or the addition of a protected method to pass in the samlResponse to set these properties.
nameid,
authenticated,
attributes,
sessionIndex,
sessionExpiration,
lastAssertionId,
lastAssertionNotOnOrAfter

Allow configuring Saml2Settings programatically

In 2.0 Saml2Settings can only be fully customized using a properties file (because some of the setXXX() methods are protected).

Sometimes it's useful to be able to customize these programatically (this was possible in 1.0).

Onelogin not returning encrypted response

I've created an integration with Onelogin that works without encryption, but after attempting to turn on encryption, login fails because the response from onelogin is not encrypted. What is the proper way to enable this?

Related settings:

# onelogin.saml.properties
###
onelogin.saml2.strict = true
onelogin.saml2.debug = false
onelogin.saml2.security.nameid_encrypted = true
onelogin.saml2.security.authnrequest_signed = true
onelogin.saml2.security.logoutrequest_signed = true
onelogin.saml2.security.logoutresponse_signed = true
onelogin.saml2.security.want_messages_signed = true
onelogin.saml2.security.want_assertions_signed = true
onelogin.saml2.security.sign_metadata = true
onelogin.saml2.security.want_assertions_encrypted = true
onelogin.saml2.security.want_nameid_encrypted = true
urn:oasis:names:tc:SAML:2.0:ac:classes:urn:oasis:names:tc:SAML:2.0:ac:classes:Password
onelogin.saml2.security.requested_authncontext = urn:oasis:names:tc:SAML:2.0:ac:classes:urn:oasis:names:tc:SAML:2.0:ac:classes:Password
onelogin.saml2.security.onelogin.saml2.security.requested_authncontextcomparison = exact
onelogin.saml2.security.want_xml_validation = true
onelogin.saml2.security.signature_algorithm = http://www.w3.org/2000/09/xmldsig#rsa-sha1
###

And onelogin.saml2.sp.entityid is configured to an endpoint which uses this properties file.

Documentation for Integrating with OneLogin SAML Test

Thanks for making java-saml available.

I'd like to learn how to use this library by connecting to the OneLogin SAML Test App.

Is there documentation on how to configure the basic web app in the java-saml repo with specifics for the OneLogin SAML Test App?

Thanks for any help on this.

Request: Support IdPs with separate URLs for logout response/request

Hello,

While working with a client to setup SSO with our application I came across this issue. The client is using the solution provided by F5 here https://f5.com/products/modules/access-policy-manager

For SLO, the server has separate URLs for when the SP wants to send a request to logout from the IdP and for when the SP wants to send the IdP a logout response. I modified the library a bit and came up with this to allow this to happen

https://gist.github.com/metal-hed/85932b301233edd5a22d2d5ffd0085b0

Would this be something that could be added into the library?

Allow retrieving the id of generated AuthnRequests

Currently the Auth.login methods return nothing, not allowing the caller to retrieve the id of the generated AuthnRequest, to be used when validating the response (com.onelogin.saml2.Auth#processResponse(java.lang.String))

Asserting request URL and Destination attribute of SAML response fails when working behind load balancer with SSL offload

When the SP consumer URL uses SSL, the client is being redirected to the https endpoint matching the Destination property. Reading the request URL form the servlet request on a server behind a load balancer that does SSL offload the URLs do not match as the request URL is perceived as http not https.
Could this check be configurable to either disable only this check or to choose to disregard the protocol in the comparison?

Be able to provide a NameIDFormat to LogoutRequest

Be able to provide a NameIDFormat to LogoutRequest, not only NameiD value

We can't assume that the NameID format stored on the settings is the same that the one the IdP uses.
Example: set unespecified on settings and get an EmailAddress format.

We should be able also to retrieve from an auth object the NameID format., right now only retrieves
the value. SAMLResponse getNameIdData method contains the format info.

Forming URL for ACS with existing query parameter fails

The ACS for google is of the form:

https://accounts.google.com/o/saml2/idp?idpid=

In AuthRequest.getSSOurl you use string concatenation to form the URL using the "?" seperator. This fails in all URLs that already have a query parameter.

I have made a local fix which simply checks whether the query string already contains "?" and if it does uses "&" instead. Happy to create a pull request, but wondered if you'd prefer to use something like apache URIBuilder (see below) to avoid other possible edge cases, as the cost of an extra dependency?

http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/utils/URIBuilder.html

It's possible to add a fake Response signature to a SAML Response, that won't be validated, and will be considered valid with settings.wantMessagesSigned set

A SAML Response with the structure:

samlp:Response ID='1'
  saml:Assertion ID='2'
    ds:Signature ref='#2'

can be modified to have a fake Signature element for the Response:

samlp:Response ID='1'
  samlp:Extensions
    saml:Response ID='fake'
      ds:Signature ref='#fake' // not verified, so can have any SignatureValue
  saml:Assertion ID='2'
    ds:Signature ref='#2'

Such a message will be considered valid even when settings.wantMessagesSigned is set, and the spoofed Response signature will not be verified.

The Assertion is still validated, and needs to be properly signed (messages without both the Response signature and the Assertion signature will be rejected), but potentially this allows the attacker to change some non-Assertion values in the message.

Response audiences are validated against currentUrl

https://github.com/onelogin/java-saml/blob/master/src/main/java/com/onelogin/saml/Response.java#L153

if (!validAudiences.isEmpty() && !this.audienceUrl.equals(currentUrl)) {
throw new Exception( this.audienceUrl + " is not a valid audience for this Response");
}

If I understand the code correctly audiences should not be validated against currentUrl but against the SP entity ID (the python lib does that).

I changed the code to:

if (!validAudiences.isEmpty() && !this.audienceUrl.equals(this.accountSettings.getIdp_sso_target_url())) { throw new Exception( this.audienceUrl + " is not a valid audience for this Response"); }

but that might be wrong since I'm not entirely familiar with that validation.

Create build file for project

Right now it's difficult for me to build the project such that it outputs a jar that I can drop into my other projects. It's also difficult to tell what the dependencies are that I will need (I found that it compiled successfully with just commons-codec:commons-codec:1.9)

I can submit a pull request for it. Does Gradle work for you? Or Maven?

SAML responses with an incomplete bearer SubjectConfirmationData are not rejected

As per SAML profiles spec

line 629 (4.1.4.2 Usage):

At lease one bearer <SubjectConfirmation> element MUST contain a
<SubjectConfirmationData> element that itself MUST contain a Recipient attribute containing
the service provider's assertion consumer service URL and a NotOnOrAfter attribute that limits the
window during which the assertion can be confirmed by the relying party.

and line 657 (4.1.4.3 Message Processing Rules):

Regardless of the SAML binding used, the service provider MUST do the following:
• Verify any signatures present on the assertion(s) or the response
• Verify that the Recipient attribute in the bearer <SubjectConfirmationData> matches
the assertion consumer service URL to which the <Response> or artifact was delivered
• Verify that the NotOnOrAfter attribute in the bearer <SubjectConfirmationData> has not
passed, subject to allowable clock skew between the providers

However currently 2.0.0 considers an assertion with a bearer SubjectConfirmationData without the Recipient or NotOnOrAfter attributes as valid:

<samlp:Response Version="2.0">
...
<saml:Subject>
...
    <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
        <saml:SubjectConfirmationData/>
    </saml:SubjectConfirmation>
</saml:Subject>
</saml:Assertion>
</samlp:Response>

Trying to concurrently verify multiple responses might fail

Java's SAX classes are not thread safe. Since the validation shares an instance of the javax.xml.validation.SchemaFactory (in com.onelogin.saml2.util.SchemaFactory) trying to run multiple threads validating Responses (using separate instances of Auth and/or Response) might fail with errors like:

org.xml.sax.SAXException: FWK005 parse may not be called while parsing.
    at com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXException(Util.java:65) ~[na:1.7.0_71]
    at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:256) ~[na:1.7.0_71]
    at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:627) ~[na:1.7.0_71]
    at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:659) ~[na:1.7.0_71]
    at com.onelogin.saml2.util.SchemaFactory.loadFromUrl(SchemaFactory.java:25) ~[classes/:na]
    at com.onelogin.saml2.util.Util.validateXML(Util.java:215) ~[classes/:na]

or

java.lang.NullPointerException: null
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas(XSDHandler.java:1445) ~[na:1.7.0_71]
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:630) ~[na:1.7.0_71]
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:616) ~[na:1.7.0_71]
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:574) ~[na:1.7.0_71]
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:540) ~[na:1.7.0_71]
    at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:252) ~[na:1.7.0_71]
    at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:627) ~[na:1.7.0_71]
    at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:659) ~[na:1.7.0_71]
    at com.onelogin.saml2.util.SchemaFactory.loadFromUrl(SchemaFactory.java:25) ~[classes/:na]
    at com.onelogin.saml2.util.Util.validateXML(Util.java:215) ~[classes/:na]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.