Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59035

Cannot configure oic-auth plugin with JCasC

XMLWordPrintable

      configuration-as-code/viewExport fails to display the oic-auth-plugin settings after manual configuration

      jenkins:
        agentProtocols:
        - "JNLP4-connect"
        - "Ping"
        disableRememberMe: false
        markupFormatter: "plainText"
        mode: NORMAL
        myViewsTabBar: "standard"
        numExecutors: 2
        primaryView:
          all:
            name: "all"
        projectNamingStrategy: "standard"
        quietPeriod: 5
        remotingSecurity:
          enabled: false
        scmCheckoutRetryCount: 0
        securityRealm: |-
          FAILED TO EXPORT
          hudson.model.Hudson#securityRealm: io.jenkins.plugins.casc.ConfiguratorException: Can't read attribute 'automanualconfigure' from org.jenkinsci.plugins.oic.OicSecurityRealm@55ca3037
            at io.jenkins.plugins.casc.Attribute._getValue(Attribute.java:392)
            at io.jenkins.plugins.casc.Attribute.getValue(Attribute.java:214)
            at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:283)
            at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:283)
            at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:201)
            at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:283)
            at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
            at io.vavr.control.Option.map(Option.java:373)
            at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
            at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
            at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:260)
            at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:239)
            at io.jenkins.plugins.casc.Configurator.describe(Configurator.java:161)
        slaveAgentPort: 50000
      

      And trying to configure oic-auth via yaml fails as well.

      Sample yaml with dummy data

      securityRealm:
        oic:
          clientId: "asdasdsad"
          clientSecret: "asdasdasd"
          tokenServerUrl: "https://asdsad/"
          authorizationServerUrl: "https:/asdasdsad"
          scopes: "openid email"
          userNameField: "UserName"
      

      Error when starting up Jenkins with the above jenkins.yaml (with correct values)

      Aug 20 17:16:49 testbox01 java[28175]: Caused by: io.jenkins.plugins.casc.ConfiguratorException: jenkins: error configuring 'jenkins' with class io.jenkins.plugins.casc.core.JenkinsConfigurator configurator
      Aug 20 17:16:49 testbox01 java[28175]: at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:670)
      Aug 20 17:16:49 testbox01 java[28175]: at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:702)
      Aug 20 17:16:49 testbox01 java[28175]: at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:686)
      Aug 20 17:16:49 testbox01 java[28175]: at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:585)
      Aug 20 17:16:49 testbox01 java[28175]: at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:280)
      Aug 20 17:16:49 testbox01 java[28175]: at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:272)
      Aug 20 17:16:49 testbox01 java[28175]: ... 13 more
      Aug 20 17:16:49 testbox01 java[28175]: Caused by: io.jenkins.plugins.casc.ConfiguratorException: oic: Failed to construct instance of class org.jenkinsci.plugins.oic.OicSecurityRealm.
      Aug 20 17:16:49 testbox01 java[28175]: Constructor: public org.jenkinsci.plugins.oic.OicSecurityRealm(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,boolean,java.lang.Boolean,java.lang.String,java.lang.String,boolean,java.lang.String,java.lang.String,java.lang.String,java.lang.String) throws java.io.IOException.
      

       

            mdoubez Michael Doubez
            cjharmath CJ Harmath
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: