web-servicesredmineredmine-api

How to log in into Redmine using REST API


I have the requirement to log in into Redmine using the REST API. Is it possible to login in Redmine using REST API? How can I handle it?


Solution

  • On the Redmine API wiki you can see the following:

    Most of the time, the API requires authentication. To enable the API-style authentication, you have to check Enable REST API in Administration -> Settings -> Authentication.

    Then, authentication can be done in 2 different ways:

    • using your regular login/password via HTTP Basic authentication.

    • using your API key which is a handy way to avoid putting a password in a script.

    The API key may be attached to each request in one of the following way:

    • passed in as a "key" parameter

    • passed in as a username with a random password via HTTP Basic authentication

    • passed in as a "X-Redmine-API-Key" HTTP header (added in Redmine 1.1.0)

    You can find your API key on your account page ( /my/account ) when logged in, on the right-hand pane of the default layout.

    If you want to use HTTP Basic Authentication you could use this:

    1.HTTP Basic auth – http://login:password@redmine.org/issues.xml
    2.HTTP Basic auth with API token and login – http://login:RANDOM_KEY@redmine.org/issues.xml- (not supported yet)
    3.HTTP Basic auth with API token – http://RANDOM_KEY:X@redmine.org/issues.xml
    4.Full token auth – http://redmine.org/issues.xml?key=RANDOM_KEY