Debugging
To enable detailed debugging, add this to yourlogback.xml
file:
IdP rejects an authentication request (AutnRequest) from app
A range of issues could cause this. Most commonly, it is because the request from the application failed validation which is often due to the IdP lacking the correct configuration. You must ensure that the endpoints and application identifiers match in the IdP’s configuration for the application. For example if using ADFS, this is the ‘Relying Party Trust’ configuration. If manually configuring this is proves problematic, you can ensure that the IdP has the correct configuration for the app by generating an SP ‘metadata’ XML file that can be imported into the IdP. To enable this you must:-
Add this to
spring-security.xml
in the filter chain:For example: -
Add the bean definition for this filter:
-
Deploy the application and browse to
http://your-app-server/saml/metadata/
. This should generate the SP metadata XML file describing the applications configuration which can then be imported to almost any compliant IdP in the administration console/configuration.
IdP rejects authentication or sends back a status code in response message indicating an error
It is worth inspecting the status code in the response message and the logs from the IdP as a next step. This issue is often found if the configuration matches at both the IdP and SP, but there is a ‘trust’ issue, which can be related to the signing certificates used. We have found some IdPs (ADFS for example) that reject self-signed certificates from the application. It is recommended to use a genuine trusted certificate to avoid this problem.Illegal Key Size error
You might find you get an error at some stage that is ajava.security.InvalidKeyException
or similar stating ‘Illegal Key Size’. This is because a key has been used with a size larger than that which the JVM accepts by default. This is a known Java issue to do with cryptography restrictions shipped with a standard JVM. The solution is to install the ‘unrestricted JCE policy files’ in the JVM on which the application is running. You can obtain this from Oracle and it is usually installed in the JRE directory in lib/security
. Make sure you install the files for the correct version of Java.