简体   繁体   中英

Use Redmine REST API for authentication

I am working on a service which requires authentication.

I would like to base the authentication on my Redmine and grant access to registered users which are members in a private project.

The membership I have figured out:

curl -v -u account:secret \
https://myredmine/projects/private/memberships.json

But how to find out if a user can authenticate?

Use /users/current.json :

curl -v -u account:secret \
https://myredmine/users/current.json

It will return 401 if the user fails to login.

Add ?include=memberships to the URL to retrieve a list of associated projects.

I don't think it will work with OpenID though.

Use the built-in API. You can enable it for each user, once you get the key:

// Pseudo-code
api_key = '65454ftfg53543f34g34f23g'
url = "http://www.myredminesite.com/projects/my_project/issues.json?key=" + api_key

You can enable the API key if you log in and click on "My Account", then on the right should be your API access key.project.

There where some issues with older version I think. I run Redmine 2.1.2.stable and that works great.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM