I want to get the information about the current logged-in user of the Jira cloud addon.
the docs suggested the /myself endpoint for this situation, but the problem is this endpoint only returns the information about the user who it's api_token is used in the app, not the user who is logged-in to the app via his/hers dashboard.
How can I do this?
thank you in advance
I understand you are creating an app for Jira Cloud. However authentication is done differently depending on what exactly you are building. From the way you have described this, it sounds like you're using basic auth. If that is the case, your app can then only authenticate as the user that has supplied their API token to your app.
Please take a look over at https://developer.atlassian.com/cloud/jira/platform/security-overview/ It explains the different methods of managing authentication depending on the type of app you are creating. To meet your needs here, you will likely need to implement OAuth 2.0 in your app (provided this is not a Forge or Connect app, those frameworks have other existing means to manage this). More details on that method can be found over in https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/ .
I hope this helps.
Ah, in that case, please see Security for Connect apps. For Connect apps, you can use two different forms of Authorization: Authorization via scopes and app users or Authorization with user impersonation. The latter form does use a JWT bearer token which uses OAuth 2.0. More details on that over in User impersonation for Connect apps.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events