Failing to get current user information with Oauth2 3LO

Hi
I made an app that use ‘Login with Atlassian’ with Oauth as described here
I am able to get the ‘accessible-resources’:

{id=myCloudId, url=coudUrl, name=theName, scopes=[read:confluence-user], ...

But then I need the user account id, so I use the get current user endpoint for Confluence.
with

GET https://api.atlassian.com/ex/confluence/myCloudId/wiki/rest/api/user/current

But there the server answer with 401 - “Unauthorized; scope does not match”, even though the doc mentions OAuth scopes required : read:confluence-user, scope that is available according to the ‘available-resources’ endpoint.

The cloudId seems to be correct (otherwise I get a 404 Not Found), and the JWT token is also correctly given (otherwise I get a 403 Current user not permitted to use Confluence)

[edit] If I try with another endpoint, for example /wiki/rest/api/space, I get “401 Token is missing required scopes: read:confluence-space.summary” which is expected.

Looks like “401 - Unauthorized; scope does not match” is the default error when we use an invalid endpoint path. /wiki/rest/api/user/anonymous and /wiki/rest/api/user/current behave as if they were no implemented.

Am I missing something ?

1 Like