Lets assume, we have a domain (say example.com
) that has two ALMs (Github and Bitbucket). Both of the ALMs have their own Bitbucket organization (say example-github
and example-bitbucket
).
We are using the users API to automatically add and remove users.
Problem: the users API returns only the last logged-in identity of the user. Expected: the API should return the both ALM identities of the user.
Example:
Assume that Alice (email: alice@example.com) has last logged in using the Bitbucket identity. Now, API call:
GET 'https://api.sonarcloud.io/users/users?email=alice@example.com'
will return:
{'users': [{'id': '12345678-1234-1234-1234-1234567890af',
'login': 'alice@bitbucket', 'name': 'Alice',
'email': 'alice@example.com', 'externalProvider': 'bitbucket',
'avatar': '1234567890abcdef1234567890abcdef'}],
'page': {'pageIndex': 1, 'pageSize': 50, 'total': 1}
}
However, if the user has logged in using the Github identity, then the same API call will return:
{'users': [{'id': '87654321-4321-4321-4321-fa0987654321',
'login': 'alice@github',
'name': 'Alice',
'email': 'alice@example.com',
'externalProvider': 'github',
'avatar': 'fedcba0987654321fedcba0987654321'}],
'page': {'pageIndex': 1, 'pageSize': 50, 'total': 1}}
This makes it impossible to build a reliable identity mapping automatically.