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

Api call with a token lead to a 403 but the user has "overall read" via "authenticated user" group

      I use "Project-based Matrix Authorization Strategy ".

      I set the group "Authenticated Users" with permission overall read, job read, credential view, view read.

      If a user try to call an api with a token like: `curl -u myuser:123456 -v -H 'Accept: application/json' https://jenkins/api/json` then the response is 403 with a HTML body in which I have "myuser is missing the Overall/Read permission"

      If I add a "overall read" permission on the "myuser" itself, then the api is working (200 + data)

      Does this mean that authenticating via a token do not add the 'authenticated' group ? Is this wanted? if so why not a "tokens" group ?

          [JENKINS-61344] Api call with a token lead to a 403 but the user has "overall read" via "authenticated user" group

          Daniel Beck added a comment -

          Overall/Read grants basic access to Jenkins. Nothing more. Users without that basically cannot do anything, except in very limited circumstances.

          Users have a group or don't, the method of authentication doesn't change what they're authorized to do.

          Daniel Beck added a comment - Overall/Read grants basic access to Jenkins. Nothing more. Users without that basically cannot do anything, except in very limited circumstances. Users have a group or don't, the method of authentication doesn't change what they're authorized to do.

          greg oire added a comment -

          From your answer, Jenkins do have a bug. If I set Overall/Read to "authenticated" user, then I expect even with a token, such policy is executed hence a user without other permission would be able to call jenkins api. It is not the case.

          greg oire added a comment - From your answer, Jenkins do have a bug. If I set Overall/Read to "authenticated" user, then I expect even with a token, such policy is executed hence a user without other permission would be able to call jenkins api. It is not the case.

          Daniel Beck added a comment -

          gregoirew Adding the authenticated pseudo-group is the responsibility of the plugin providing authentication (i.e. security realm). So there seems to be a bug here, I agree, but not in matrix-auth.

          Daniel Beck added a comment - gregoirew Adding the authenticated pseudo-group is the responsibility of the plugin providing authentication (i.e. security realm). So there seems to be a bug here, I agree, but not in matrix-auth.

          greg oire added a comment -

          Is there a generic specific handler for token somewhere or each authentication handler duplicate the token authentication management ?

          greg oire added a comment - Is there a generic specific handler for token somewhere or each authentication handler duplicate the token authentication management ?

          greg oire added a comment -

          OK, I found the code, but will need to debug as at first sight it seems correct...

          Thank you.

          greg oire added a comment - OK, I found the code, but will need to debug as at first sight it seems correct... Thank you.

            danielbeck Daniel Beck
            gregoirew greg oire
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: