How to login to Redmine using REST API

I have a requirement to login to Redmine using REST API. Can I login to Redmine using REST API? How can I handle this?

+3


source to share


1 answer


In the Redmine API wiki, you can see the following:

In most cases, the API requires authentication. To enable API style authentication, you must check Enable REST API in Administration → Settings → Authentication.

Authentication can then be done in two different ways:

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

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

An API key can be attached to each request in one of the following ways:

  • passed as parameter "key"

  • passed as username with random password via HTTP Authentication

  • passed in as "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 you login in the right pane of the default layout.



If you want to use HTTP Basic Authentication , you can 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

      

+7


source







All Articles