Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain useraccountid for auth purposes

Tom Cartwright
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 13, 2019

Hello,

We are creating an Atlassian connect app that will use the rest apis to get information about the boards and epics for a given account. We have been able to use the data in the app installation callback to generate a `jwt` token, and then following this guide, create an access token to impersonate a user and obtain the data we want.

But! So far the only way we have been able to obtain the `useraccountid` to generate the `jwt` is by visiting the profile page of a user and copying the value out of the url. How do you programmatically obtain this value for a given user? Do you have to send the user who you wish to impersonate through an oauth process? Or, as an installed connect app, is there a way to find an `useraccountid` for a given user using an api?

Thanks

1 answer

0 votes
Tom Cartwright
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 13, 2019

Follow up to this. From reading through this issue, https://ecosystem.atlassian.net/browse/AC-2442, we were able to get the app installers useraccountid and user_key from the installation callback and signing a jwt with either of these worked - we are able to find other users information on the `/rest/api/3/user/search` endpoint. But this still doesn't feel like a great flow for all users - I was expecting to ask users to perform an oauth-like flow before I would be able to impersonate them on the rest APIs.

Suggest an answer

Log in or Sign up to answer