-
Bug
-
Resolution: Fixed
-
Minor
-
OS: Amazon Linux release 2 (Karoo)
Jenkins version: 2.282
saml-plugin version: 2.0.0
-
-
saml-2.0.3
After upgrading to 2.0.0, when users are redirected back to `/securityRealm/finishLogin ` the following exception is thrown:
WARNING o.e.j.s.h.ContextHandler$Context#log: Error while serving http://jenkins.domain/securityRealm/finishLogin java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List at org.jenkinsci.plugins.saml.SamlSecurityRealm.modifyUserFullName(SamlSecurityRealm.java:453) at org.jenkinsci.plugins.saml.SamlSecurityRealm.doFinishLogin(SamlSecurityRealm.java:335) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396) Caused: java.lang.reflect.InvocationTargetException
However if you continue into Jenkins, the user is authenticated and can browse freely. It will happen every time a user needs to be re-authenticated.
We've hit the same issue after upgrading to 2.0.0. It looks like the issue is that the plugin interprets the configured display name attribute as multi-value. The same is true for the email attribute. However, in the returned SAML assertion, these attributes are single-value. In my case, the offending attribute was "email" - the IDP does not return a display name attribute. Removing the email attribute mapping (although there's a tooltip that it's recommended to set it) solves the error.