Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to fetch the user to an OAuth token in Stash?

Robert Reiz October 2, 2014

Hi. I currently try to implement a "Login with Stash" button into VersionEye Enterprise. If somebody logs in with his Stash Account into VersionEye Enterprise, I need at least his name and his email address from the Stash API to create the user in VersionEye Enterprise. 

The OAuth Authentication works so far. I get a valid token & secret and I can make authenticated request against the Stash REST API. But what is the Endpoint to retrieve the current user object to the OAuth token? On the Bitbucket API it is "/api/1.0/user". I couldn't find something similar in this documentation: https://developer.atlassian.com/static/rest/stash/3.3.1/stash-rest.html

In this example here they show how it works for JIRA. They use these endpoint "/rest/auth/latest/session". But that doesn't work for Stash. 

Please help. Feedback is appreciated. 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 3, 2014

Hi Robert,

There isn't currently a end-point that returns the profile of the currently authenticated Stash user. However you can retrieve the name of the currently authenticated user from the whoami end-point that I described in this answer and then use that to retrieve the current user's profile.

cheers,

Tim

Robert Reiz October 5, 2014

Hi Tim. Many Thanks for the fast response. That worked out. "Login with Stash" button works like charm ;-) The other Endpoints to fetch repos, branches and files are quiet good documented. It all worked like expected.

TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2014

Great to hear it! I'll have to have a play with VersionEye - looks very cool. Now that you're up & running, would you mind marking this answer as accepted?

Robert Reiz October 6, 2014

Hi Tim. I just upvoted your answer. For me your answer is marked as accepted. At least I see the green bubble :-) VersionEye Enterprise is currently in private Beta. But I will open it soon for a wider audience. Most of the B2B clients have either GitHub Enterprise or Stash as SCM. That's why the Stash integration was very important to me. Now it works like charm. Thanks for the great support.

TAGS
AUG Leaders

Atlassian Community Events