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

Retroactively add users to teams during OIDC connect #1386

Closed
wants to merge 1 commit into from

Conversation

darius-m
Copy link
Contributor

@darius-m darius-m commented Sep 28, 2020

The current code listens to events like enrolling / unenrolling / changing user enrolment information if the changes are made after the user connects to OIDC.

However, consider the following scenario (each item in the list happens before the next item):

  • a user is created using another authentication method, or manually by the administrator
  • the user is enrolled into courses A, B and C
  • the user is synced with the active directory
  • the user is enrolled into course D

Because the enrolment into course D happened after synchronizing the account the AD, the database contains an o365 local object for the user, so a \local_o365\obj\o365user instance can be created. This means that the handlers for user enrolment like handle_user_enrolment_created can add the user to the team. In contrast, since the enrolments for courses A, B and C were created before the user was synchronized, an object did not exist, so the user was not added to the team.

The changes check what courses the user was enrolled into before connecting to OIDC and adding them to the teams according to their enrolment status, so at least the changes are visible once the user connects their account.

Signed-off-by: Darius Mihai <dariusmihaim@gmail.com>
@ghost
Copy link

ghost commented Sep 28, 2020

CLA assistant check
All CLA requirements met.

@weilai-irl weilai-irl self-assigned this Jan 28, 2021
@weilai-irl weilai-irl added this to the Release 2021-03 milestone Jan 28, 2021
@weilai-irl
Copy link
Collaborator

Pull requests #1589 and #1590 were created from this pull request, and have been merged to the latest release.

@weilai-irl weilai-irl closed this Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants