Project

General

Profile

Actions

Feature #8529

closed

Get the API key of the user through REST API

Added by Alex Last over 13 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Category:
REST API
Target version:
Start date:
2011-06-04
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

I'm trying to write an automated test in Redmine Java API for case when getUsers() throws AuthorizationException for non-admin.

to do that, I first create a new user through REST API (using admin account), and then I want to send "getUsers()" request with the new user's API access key.
the problem is that I don't see a way to retrieve the API key of the user I just created.
I understand this is probably due to security reasons.
what's the right way to solve this problem?

it would be great if REST API supported the concept of "login" so that REST users would be able to "login" through REST API using their login&password (instead of API access key!) and then they'd receive some "session key" they could use temporarily for this session.

this would eliminate the problem I described above, and plus simplify the REST API usage in various UIs (people are often confused about "api access key", they want to use their login&password).

Actions #1

Updated by Alex Last over 13 years ago

never mind, feel free to close this request. I see basic HTTP auth is supported, so no API key is required. I can specify user's password when creating the user, so this solves my problem.

Actions #2

Updated by Frank Schwarz almost 12 years ago

It would be great for (mobile) apps to retrieve the API key:

  1. the mobile app asks for username and password
  2. the mobile app logs in using basic authentication (with an https url)
  3. the app retrieves the api key of the currently logged in user
  4. the app stores the api key permanently for authenticating the user the next time
Actions #3

Updated by Jean-Philippe Lang almost 12 years ago

  • Subject changed from get the api key of the user through REST API to Get the API key of the user through REST API
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.3.0
  • Resolution set to Fixed

Good point. API key added in r11518 to /users/current.format.

Actions #4

Updated by Jean-Philippe Lang almost 12 years ago

  • Status changed from Resolved to Closed

Merged.

Actions

Also available in: Atom PDF