REST API for who the authenticated user is

Hi,

Is there a way to query via the API who the user holding the API access token being used for the request is -- e.g. something like an /app/rest/auth or /app/rest/users/self endpoint that returns (or contains a url to) the authenticated User model? An example use-case is where the access token is used by a custom tool/UI, which presents the name of the currently authenticated user in its interface.

Thanks!

1
3 comments
Hello Ali,
There is no such REST API method currently that does what you want to do.
However, it would be possible to know who the authenticated user is by making a request to <TeamCity URL>/profile.html authenticated with a token, and then parse the page to fetch the username.
Another workaround would be to, for instance, create a new dummy project or do something else with low impact which is captured by audit, and then find out the identity of the user for that event fetched via <TeamCity URL>/app/rest/audit.
 
Thank you,
 
Guilherme
0
Avatar
Permanently deleted user

Ali Tavakoli, Guilherme Barbosa, there's already existing request to get currently authenticated user data – /app/rest/users/current.

1

@... thanks for the info!

Would you know if there is a YouTrack issue that I can follow for this?

0

Please sign in to leave a comment.