- 
                Notifications
    You must be signed in to change notification settings 
- Fork 413
Connecting with Cookie‐Based Auth
        Robert Brodie edited this page Apr 27, 2024 
        ·
        2 revisions
      
    Jira supports cookie based authentication whereby user credentials are passed to Jira via a Jira REST API call. This call returns a session cookie which must then be sent to all following JIRA REST API calls.
To enable cookie based authentication, set :auth_type to :cookie, set :use_cookies to true and set :username and :password accordingly.
options = {
  :username           => '<Your username>',
  :password           => '<Your password>',
  :site               => 'https://<subdomain>.atlassian.net/',
  :context_path       => '',
  :auth_type          => :cookie,  # Set cookie based authentication
  :use_cookies        => true,     # Send cookies with each request
  :additional_cookies => ['AUTH=vV7uzixt0SScJKg7'] # Optional cookies to send
                                                   # with each request
}
client = JIRA::Client.new(options)- Some authentication schemes might require additional cookies to be sent with each request. Cookies added to the :additional_cookiesoption will be added to each request. This option should be an array of strings representing each cookie to add to the request.
- Some authentication schemes that require additional cookies ignore the username and password sent in the Jira REST API call. For those use cases, :usernameand:passwordmay be omitted fromoptions.