SAML SP for Java: CONFIG_ERROR: ServiceProvider: no identity provider

Problem

After installing SAML SP for Java and trying to access a protected resource, an exception containing the message:


HTTP Status 500 - com.ubisecure.saml2.sp.ServiceProviderException: CONFIG_ERROR: ServiceProvider: no identity provider
type Exception report
message com.ubisecure.saml2.sp.ServiceProviderException: CONFIG_ERROR: ServiceProvider: no identity provider
description The server encountered an internal error that prevented it from fulfilling this request.

Solution

This can be caused by an incorrect, corrupt or missing IDP metadata file. The file is located in the WEB-INF\saml2\sp\metadata directory and should be called metadata.xml
Check and ensure that:

  • the file exists and read access writes are set appropriately
  • the file encoding is UTF-8
  • the file contains XML with an EntityDescriptor containing an IDPSSODescriptor element.