• Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • role-strategy-plugin

      When using the Role Strategy plugin, a non-admin user (having only Overall/read permission) can't use his API Token to interact with the Jenkins instance. However, using the user's LDAP password works and if the user is given the Global Job/Read permission, it also works.

      Detail:

       I manage a lot of different projects in a multi-tenant Jenkins instance, using the RBAS plugin, by defining project roles for each Folder I create.

      We received a request to download Maven artifacts via curl/wget from a certain project Folder.

      All users of the Jenkins instance have the Overall/Read permission, as can be seen in Selection_477.jpg.

      The users who have access to that folder DO have the Job/Read permission, as part of the Project Role, as can be seen in Selection_478.jpg .

      However, when a person from that project tries to access the REST API with his token, he receives the following error:

       

      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      <title>Error 404 Not Found</title>
      </head>
      <body><h2>HTTP ERROR 404</h2>
      <p>Problem accessing /jenkins/job/DFP/job/DataFab/job/build/job/core/lastSuccessfulBuild/api/json/. Reason:
      <pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

      </body>
      </html>

      And if he tries the same with his LDAP password, the call succeeds.

      When I added the Job/Read permission as a Global permission, it also succeeded.

      Any ideas?

       

          [JENKINS-45479] API tokens and Job/Read permission issue

          Gad Maor created issue -
          Gad Maor made changes -
          Description Original: When using the Role Strategy plugin, a non-admin user (having only Overall/read permission) can't use his API Token to interact with the Jenkins instance. However, using the user's LDAP password works and if the user is given the Global Job/Read permission, it also works.

          Detail:

           I manage a lot of different projects in a multi-tenant Jenkins instance, using the RBAS plugin, by defining project roles for each Folder I create.

          We received a request to download Maven artifacts via curl/wget from a certain project Folder.

          All users of the Jenkins instance have the Overall/Read permission, as can be seen in the attached image.

          The users who have access to that folder DO have the Job/Read permission, as part of the Project Role, as can be seen in Selection_478.jpg .

          However, when a person from that project tries to access the REST API with his token, he receives the following error:

           

          <html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
          <title>Error 404 Not Found</title>
          </head>
          <body><h2>HTTP ERROR 404</h2>
          <p>Problem accessing /jenkins/job/DFP/job/DataFab/job/build/job/core/lastSuccessfulBuild/api/json/. Reason:
          <pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://&lt;/small&gt;&lt;/i&gt;&lt;hr/>

          </body>
          </html>

          And if he tries the same with his LDAP password, the call succeeds.

          When I added the Job/Read as a Global permission, it also succeeded.

          Any ideas?

           
          New: When using the Role Strategy plugin, a non-admin user (having only Overall/read permission) can't use his API Token to interact with the Jenkins instance. However, using the user's LDAP password works and if the user is given the Global Job/Read permission, it also works.

          Detail:

           I manage a lot of different projects in a multi-tenant Jenkins instance, using the RBAS plugin, by defining project roles for each Folder I create.

          We received a request to download Maven artifacts via curl/wget from a certain project Folder.

          All users of the Jenkins instance have the Overall/Read permission, as can be seen in Selection_477.jpg.

          The users who have access to that folder DO have the Job/Read permission, as part of the Project Role, as can be seen in Selection_478.jpg .

          However, when a person from that project tries to access the REST API with his token, he receives the following error:

           

          <html>
           <head>
           <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
           <title>Error 404 Not Found</title>
           </head>
           <body><h2>HTTP ERROR 404</h2>
           <p>Problem accessing /jenkins/job/DFP/job/DataFab/job/build/job/core/lastSuccessfulBuild/api/json/. Reason:
           <pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://&lt;/small&gt;&lt;/i&gt;&lt;hr/>

          </body>
           </html>

          And if he tries the same with his LDAP password, the call succeeds.

          When I added the Job/Read as a Global permission, it also succeeded.

          Any ideas?

           

          Oleg Nenashev added a comment -

          Could you please check it with another Authorization Strategy? I doubt it is a Role Strategy issue, but it may be an issue in the core

          Oleg Nenashev added a comment - Could you please check it with another Authorization Strategy? I doubt it is a Role Strategy issue, but it may be an issue in the core
          Gad Maor made changes -
          Description Original: When using the Role Strategy plugin, a non-admin user (having only Overall/read permission) can't use his API Token to interact with the Jenkins instance. However, using the user's LDAP password works and if the user is given the Global Job/Read permission, it also works.

          Detail:

           I manage a lot of different projects in a multi-tenant Jenkins instance, using the RBAS plugin, by defining project roles for each Folder I create.

          We received a request to download Maven artifacts via curl/wget from a certain project Folder.

          All users of the Jenkins instance have the Overall/Read permission, as can be seen in Selection_477.jpg.

          The users who have access to that folder DO have the Job/Read permission, as part of the Project Role, as can be seen in Selection_478.jpg .

          However, when a person from that project tries to access the REST API with his token, he receives the following error:

           

          <html>
           <head>
           <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
           <title>Error 404 Not Found</title>
           </head>
           <body><h2>HTTP ERROR 404</h2>
           <p>Problem accessing /jenkins/job/DFP/job/DataFab/job/build/job/core/lastSuccessfulBuild/api/json/. Reason:
           <pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://&lt;/small&gt;&lt;/i&gt;&lt;hr/>

          </body>
           </html>

          And if he tries the same with his LDAP password, the call succeeds.

          When I added the Job/Read as a Global permission, it also succeeded.

          Any ideas?

           
          New: When using the Role Strategy plugin, a non-admin user (having only Overall/read permission) can't use his API Token to interact with the Jenkins instance. However, using the user's LDAP password works and if the user is given the Global Job/Read permission, it also works.

          Detail:

           I manage a lot of different projects in a multi-tenant Jenkins instance, using the RBAS plugin, by defining project roles for each Folder I create.

          We received a request to download Maven artifacts via curl/wget from a certain project Folder.

          All users of the Jenkins instance have the Overall/Read permission, as can be seen in Selection_477.jpg.

          The users who have access to that folder DO have the Job/Read permission, as part of the Project Role, as can be seen in Selection_478.jpg .

          However, when a person from that project tries to access the REST API with his token, he receives the following error:

           

          <html>
           <head>
           <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
           <title>Error 404 Not Found</title>
           </head>
           <body><h2>HTTP ERROR 404</h2>
           <p>Problem accessing /jenkins/job/DFP/job/DataFab/job/build/job/core/lastSuccessfulBuild/api/json/. Reason:
           <pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://&lt;/small&gt;&lt;/i&gt;&lt;hr/>

          </body>
           </html>

          And if he tries the same with his LDAP password, the call succeeds.

          When I added the Job/Read permission as a Global permission, it also succeeded.

          Any ideas?

           

          Oleg Nenashev added a comment -

          ping

          Oleg Nenashev added a comment - ping
          Lasse Faarbæk made changes -
          Attachment New: image-2018-08-15-09-18-56-709.png [ 43752 ]
          Lasse Faarbæk made changes -
          Attachment New: image-2018-08-15-09-21-58-235.png [ 43753 ]
          Lasse Faarbæk made changes -
          Attachment New: image-2018-08-15-09-22-36-837.png [ 43754 ]

          Oleg Nenashev added a comment -

          No response from the reporter

          Oleg Nenashev added a comment - No response from the reporter
          Oleg Nenashev made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]

            oleg_nenashev Oleg Nenashev
            bienstock Gad Maor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: