Hi,
We are facing the following challenge trying to let guest user access all functionalities in our Connect app.
We need to retrieve the user info (e.g. displayName, avatar URL) for Confluence guest users (so that they can add comment in our app).
We know that from the client side it is it possible to use the “/rest/api/user/current” API. However we need to retrieve the info also from our server side in order to validate the information passed to the server (for security reason).
When using the “/rest/api/user/” with the accountId of the guest user we receive a 404 due to the limited credential of the guest user.
If you have the Guest user account ID, try something like this: https://{{SITENAME}}.atlassian.net/wiki/rest/api/search?sitePermissionTypeFilter=externalCollaborator&cql=user%3D%22{{ACCOUNT_ID}}%22
Until now we didn’t have the need to use the “connect app user” for accessing the REST API. Which kind of authentication are you using in this case? We generally get the token using the https://oauth-2-authorization-server.services.atlassian.com end point. In this case which “accountId” should we use for the “connect app user”?
HI Chris,
Digging in the code of ACE toolkit I was able to answer myself the authentication question.
In order to call the API on behalf of the app (and not on behalf of the user) the requested authentication is 'Authorization': 'JWT ' jwtToken.
When creating the jwtToken payload, it is sufficient to not specify the sub parameter (while in case of user impersonation, the sub parameter is equal to the accountId of the user).
Hope this can help other dev stumbling on the same issue.