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

Username Password for OAuth based authentication

    Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: swarm-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      Many are using GitHub OAuath or other auth provider. It seems that this plugin only works with username/passoword.

      As with many auth providers its not possible to create a technical user  it is not possible to connect to master. It would be good if other connection option would be provided other then username/passowrd.

       

       

      This is the error that I get when trying to use the github username/password.

      // stacktrace when trying to log in with github username/password
      Dec 26, 2017 12:46:35 PM hudson.plugins.swarm.SwarmClient discoverFromMasterUrl
      
      SEVERE: Failed to fetch slave info from Jenkins, HTTP response code: 500
      
      Dec 26, 2017 12:46:35 PM hudson.plugins.swarm.Client run
      
      SEVERE: RetryException occurred
      
      hudson.plugins.swarm.RetryException: Failed to fetch slave info from Jenkins, HTTP response code: 500
      
      at hudson.plugins.swarm.SwarmClient.discoverFromMasterUrl(SwarmClient.java:233)
      
      at hudson.plugins.swarm.Client.run(Client.java:139)
      
      at hudson.plugins.swarm.Client.main(Client.java:112)
      
      
      
      

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            KK does not maintain this plugin anymore. Moving to unassigned to set the expectation

            Show
            oleg_nenashev Oleg Nenashev added a comment - KK does not maintain this plugin anymore. Moving to unassigned to set the expectation
            Hide
            meidan Meidan Alon added a comment -

            Vadimo did you find a solution for this?

            Show
            meidan Meidan Alon added a comment - Vadimo did you find a solution for this?
            Hide
            uuaynr Wayne Warren added a comment -

            A simple workaround for this problem:

            ```

            curl https://api.github.com/authorizations --user $USERNAME --data '{"scopes":["user:email","read:org"],"note":"jenkins swarm clients"}'

            ```

            You will be prompted to enter your password. The response will look something like:

            ```

            {   ...   "token": "<TOKEN>"   ... }

            ```

            You would then take the 'token' value from here for use as the `-password` field in the swarm client command line. That's all there is to it!

             

            The token doesn't expire as far as I can tell; you can manually revoke it from the github web ui at https://github.com/settings/tokens. The `note` field in the abovementioned curl call ends up being the name of the token (attempting to obtain a new token with the same name will fail.

             

            Come to think of it you don't need to use the above curl command since you can just generate a token at the same tokens url; it just needs `user:email` and `read:org` permissions.

            Show
            uuaynr Wayne Warren added a comment - A simple workaround for this problem: ``` curl https://api.github.com/authorizations --user $USERNAME --data '{"scopes": ["user:email","read:org"] ,"note":"jenkins swarm clients"}' ``` You will be prompted to enter your password. The response will look something like: ``` {   ...   "token": "<TOKEN>"   ... } ``` You would then take the 'token' value from here for use as the `-password` field in the swarm client command line. That's all there is to it!   The token doesn't expire as far as I can tell; you can manually revoke it from the github web ui at https://github.com/settings/tokens. The `note` field in the abovementioned curl call ends up being the name of the token (attempting to obtain a new token with the same name will fail.   Come to think of it you don't need to use the above curl command since you can just generate a token at the same tokens url; it just needs `user:email` and `read:org` permissions.
            Hide
            basil Basil Crow added a comment -

            Duplicate of JENKINS-17144.

            Show
            basil Basil Crow added a comment - Duplicate of JENKINS-17144 .

              People

              • Assignee:
                Unassigned
                Reporter:
                vadimo Vadimo
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: