Invalid redirect error login to Jenkins console after upgrade in OpenShift 4

Solution Verified - Updated -

Issue

  • Unable to login into Jenkins console, post upgrading to Jenkins version 4.14 or newer
  • After clicking the Log in with OpenShift button to log into Jenkins, it fails with the following error:

    {"error":"invalid_request","error_description":"The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.","state":"NDFiM2Y3NTUtZjZkYi00"}
    
  • Below error is observed in the Jenkins logs:

    Jenkins URL set to: https://jenkins-url.example.com/ in file: /var/lib/jenkins/jenkins.model.JenkinsLocationConfiguration.xml
    
    WARNING org.eclipse.jetty.server.handler.ContextHandler$Context log Error while serving https://jenkins-url-2.example.com/securityRealm/commenceLogin
    java.lang.reflect.InvocationTargetException
        [...]
    Caused by: java.net.MalformedURLException: invalid redirect https://jenkins-url-2.example.com/
    at org.openshift.jenkins.plugins.openshiftlogin.OpenShiftOAuth2SecurityRealm.doCommenceLogin(OpenShiftOAuth2SecurityRealm.java:1078)
        [...]
    java.net.MalformedURLException: invalid redirect https://jenkins-url-2.example.com/
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4.14
  • Jenkins
  • Jenkins Openshift Login Plugin

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content