Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Create Users Via Concord #3467

Closed
rajadain opened this issue Jan 25, 2022 · 2 comments
Closed

Cannot Create Users Via Concord #3467

rajadain opened this issue Jan 25, 2022 · 2 comments
Assignees
Labels
bug NSF Funding Source: National Science Foundation production

Comments

@rajadain
Copy link
Member

See https://rollbar.com/WikiWatershed/ModelMyWatershed/items/221/

@rajadain rajadain added the NSF Funding Source: National Science Foundation label Feb 17, 2022
@rajadain rajadain self-assigned this Feb 17, 2022
@rajadain
Copy link
Member Author

This is caused by this commit: django/django@4b9330c

which makes it necessary for custom authentication backends to explicitly take a request parameter in their authenticate method, here:

def authenticate(self, sso_id=None):
if sso_id is not None:
try:
query = {self.SSOField: sso_id}
user = self.SSOUserModel.objects.get(**query).user
return user
except ObjectDoesNotExist:
return None
return None

@rajadain
Copy link
Member Author

This bug causes new users to be created successfully, but they are unable to be authenticated afterwards. This leads to multiple users being created:

SELECT c.concord_id, u.id, u.username, COUNT(p.id) AS projects
FROM user_concorduser c
	INNER JOIN auth_user u ON c.user_id = u.id
	LEFT JOIN modeling_project p ON u.id = p.user_id
WHERE c.concord_id IN (
	SELECT concord_id
	FROM user_concorduser
	GROUP BY concord_id
	HAVING COUNT(user_id) > 1
)
GROUP BY c.concord_id, u.id, u.username
ORDER BY concord_id, projects DESC;
concord_id id username projects
397987 11005 ebrownson.concord 8
397987 12722 ebrownson.concord1 0
397987 12725 ebrownson.concord4 0
397987 12721 ebrownson.concord0 0
397987 12723 ebrownson.concord2 0
397987 12724 ebrownson.concord3 0
526224 10653 hhood.concord 4
526224 12738 hhood.concord0 0
588729 12743 WSTEMKline.concord2 0
588729 10926 WSTEMKline.concord 0
588729 12742 WSTEMKline.concord1 0
588729 12739 WSTEMKline.concord0 0

As can be seen above, some users that have tried to login have been unable to, and have had multiple accounts made for them.

I'm going to delete the ones with 0 projects when this is deployed, so that those users can login correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug NSF Funding Source: National Science Foundation production
Projects
None yet
Development

No branches or pull requests

2 participants