diff --git a/social_core/backends/atlassian.py b/social_core/backends/atlassian.py index 2c3e1a4c..d82cbaef 100644 --- a/social_core/backends/atlassian.py +++ b/social_core/backends/atlassian.py @@ -22,7 +22,7 @@ def auth_params(self, state=None): def get_user_details(self, response): fullname, first_name, last_name = self.get_user_names(response["displayName"]) return { - "username": response["name"], + "username": response["accountId"], "email": response["emailAddress"], "fullname": fullname, "first_name": first_name, diff --git a/social_core/tests/backends/test_atlassian.py b/social_core/tests/backends/test_atlassian.py index caa26e19..cc74e6f3 100644 --- a/social_core/tests/backends/test_atlassian.py +++ b/social_core/tests/backends/test_atlassian.py @@ -9,7 +9,7 @@ class AtlassianOAuth2Test(OAuth2Test): backend_path = "social_core.backends.atlassian.AtlassianOAuth2" tenant_url = "https://api.atlassian.com/oauth/token/accessible-resources" user_data_url = "https://api.atlassian.com/ex/jira/FAKED_CLOUD_ID/rest/api/2/myself" - expected_username = "erlich" + expected_username = "9927935d01-92a7-4687-8272-a9b8d3b2ae2e" access_token_body = json.dumps({"access_token": "aviato", "token_type": "bearer"}) tenant_data_body = json.dumps( [ @@ -26,7 +26,6 @@ class AtlassianOAuth2Test(OAuth2Test): "self": "http://bachmanity.atlassian.net/rest/api/3/user?username=erlich", "key": "erlich", "accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e", - "name": "erlich", "emailAddress": "erlich@bachmanity.com", "avatarUrls": { "48x48": "http://bachmanity.atlassian.net/secure/useravatar?size=large&ownerId=erlich",