Issue #150 wontfix

Users should be able to access their own information in the rest API

DRayX
created an issue

A user should be able to retreive their own information from <SCM-Manager Base URL>/api/rest/users/<username>.<json|xml> even if they are not an administrator. They should of course not be able to see the all users one, but the ability to retrieve their own would be useful.

Comments (4)

  1. Sebastian Sdorra repo owner

    A user could get informations of his account by using the authentication endpoint:

    <SCM-Manager Base URL>/api/rest/authentication.<json|xml>

    But there is a bug with basic authentication on this endpoint. You have to use the form based authentication. Here is an example with curl:

    curl http://localhost:8080/scm/api/rest/authentication/login.xml --data 'username=scmadmin&password=scmadmin'

    This will return a xml or json scmstate object which contains the current user object.

    I will fix the basic authentication with the next version, but i will not change the rules for the user endpoint. The user endpoint is only for administrators.

  2. DRayX reporter

    How is that basic? It documents everything. Seriously, it's fantastically better than guessing. Thank you very much.

  3. Log in to comment