sumoheavy / jira-ruby

A Ruby gem for the JIRA REST API
MIT License
654 stars 412 forks source link

Update documentation regarding authentication via Personal Access Tokens #424

Closed DylanEtris closed 3 weeks ago

DylanEtris commented 8 months ago

Subject of the Issue

The documentation in the README regarding authentication with Personal Access Tokens is misleading. The documentation says "Specifically, the paremeters :username and :password are not needed.", yet the example provided shows the two parameters being used:

options = {
  :site               => 'http://mydomain.atlassian.net:443/',
  :context_path       => '',
  :username           => '<the email you sign-in to JIRA>',
  :password           => api_token,
  :auth_type          => :basic
}

Expected Behavior

In my experience, the options need to be configured as follows to connect with a PAT:

options = {
  :site               => 'http://mydomain.atlassian.net:443/',
  :username           => '<the email you sign-in to Jira>',
  :password           => '',
  :default_headers => { 'Authorization' =>  "Bearer PERSONAL_ACCESS_TOKEN" }
  :auth_type          => :basic
}

The documentation should be updated to include a correct set of options, and the description should be updated to reflect the changes.

I hope this is the right place to raise an issue like this.