Issue
When CloudBees CI is configured to use SSO Relay for CloudBees CI single sign-on in OIDC mode, users experience login failures after the identity provider (IdP) completes authentication. The SSO relay service is stripping all extra URL parameters from the authorization response, including the iss (issuer) parameter.
This issue is particularly triggered by recent changes in the behavior of identity providers such as Google, which now include the iss parameter in the OIDC authorization response URL.
The following error is observed in the CloudBees CI logs when the iss parameter is stripped:
WARNING h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID ... org.pac4j.oidc.exceptions.OidcIssuerMismatchException: Issuer mismatch, possible mix-up attack. at PluginClassLoader for oic-auth//org.pac4j.oidc.credentials.extractor.OidcCredentialsExtractor.extract(OidcCredentialsExtractor.java:134) at PluginClassLoader for oic-auth//org.pac4j.core.client.BaseClient.getCredentials(BaseClient.java:80) at PluginClassLoader for oic-auth//org.jenkinsci.plugins.oic.OicSecurityRealm.doFinishLogin(OicSecurityRealm.java:1147)
Resolution
This article will be updated once a fix is available. Until then, see the Workarounds section below.
Workarounds
-
If the IdP supports configuration, disable inclusion of the
issparameter in the authorization response URL. -
After you encounter a login failure, add the missing
issparameter back to the URL in the browser’s address bar and submit the form. For Google as the IdP, it would be&iss=https://accounts.google.comadded to the end of the URL. -
Disable SSO Relay for CloudBees CI single sign-on until the fix is available.
-
Switch the configuration mode of the
oic-authplugin fromDiscovery via well-known endpointtoManualand provide the required configuration values for your provider in the operations center security configuration.
As an alternative, contact CloudBees Support for guidance specific to your IdP and CloudBees CI configuration.
These workarounds are temporary until a fix is available in a CloudBees CI release that correctly preserves the iss parameter through the SSO relay service.
|