Hello,
in the Stash REST API, after having retrieved an oauth token, I'd like to get the identity of the connected user (username, email, ...). But I can't find a resource in the doc that let me do it without knowing the username at least.
Is there a way to achieve this without knowing the username?
Any help is appreciated
Thanks!
Pascal
Community moderators have prevented the ability to post new answers.
Hi Pascal,
There isn't a resource that returns all of the authenticated user's profile information that I know of (though this sounds like a useful feature - I'd raise an issue at https://stash.atlassian.com in the STASH project to request it). However, you can retrieve the username of the currently authenticated user by doing a GET to the following resource (relative to the base URL of your Stash server):
/plugins/servlet/applinks/whoami
You can then use this username to retrieve the rest of the user's profile data from the REST API.
Hope this helps!
cheers,
Tim
Great! Thank you very much! That saves me. I'll create an issue shortly.This should at least be part of the documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.