This repository was archived by the owner on Nov 4, 2024. It is now read-only.
ARCH-603: (part 1) update lms_user_id via social-auth for analytics#2191
Merged
ARCH-603: (part 1) update lms_user_id via social-auth for analytics#2191
Conversation
0ef4888 to
a3da937
Compare
robrap
commented
Mar 26, 2019
Contributor
Author
|
@nasthagiri @douglashall: This is ready for review with the caveat that tests may not be passing. I was having difficulty running them locally. |
3e8be61 to
b2c3c5c
Compare
douglashall
approved these changes
Mar 28, 2019
This refactor will grab the (LMS) user_id from social-auth extra_data in the database, if it is available, and provide it to the analytics code as the user tracking id. The different user ids are also added to NewRelic (temporarily) to help ensure all is well. The new custom metrics are: - lms_user_id_tracking_context (only available for LMS to ecommerce calls) - lms_user_id_social_auth (should be None until part 2, see below) - ecommerce_user_id This is part 1, because part 2 will include the auth-backends upgrade that will make the user_id available from social-auth. This upgrade has two prerequesites: 1. A fix to LMS that enable the scope user_id to work. 2. Configuring the oauth application for ecommerce sso to have access to the user_id scope. ARCH-603
631c899 to
bacbd6f
Compare
This middleware was mistakenly added a second time, so removing it.
robrap
added a commit
that referenced
this pull request
Mar 28, 2019
This is part 2 of a 2 part change to get the user_id from social-auth during the oAuth2+SSO flow to the database, and available to ecommerce for use with analytics. Part 2 simply has the upgrade to auth-backends 2.0.0. This version of auth-backends will actually store the user_id in the social-auth table, making it available to the code from (part 1 #2191) that reads this user_id and makes it available to the analytics code. This upgrade has two pre-requisites: 1. A fix to LMS that enables the scope user_id to work at all. 2. Configuring the oauth application for ecommerce-sso to have access to the user_id scope. ARCH-603
2 tasks
robrap
added a commit
that referenced
this pull request
Mar 29, 2019
This is part 2 of a 2 part change to get the user_id from social-auth during the oAuth2+SSO flow to the database, and available to ecommerce for use with analytics. Part 2 simply has the upgrade to auth-backends 2.0.0. This version of auth-backends will actually store the user_id in the social-auth table, making it available to the code from (part 1 #2191) that reads this user_id and makes it available to the analytics code. This upgrade has two pre-requisites: 1. A fix to LMS that enables the scope user_id to work at all. 2. Configuring the oauth application for ecommerce-sso to have access to the user_id scope. ARCH-603
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When social-auth makes user_id available to ecommerce, uses this as the backup lms_user_id for later analytics calls.
This is part 1 of a two part change. This code will use the user_id from social-auth when it is available, but it won't yet be available in part 1. It will start writing some NewRelic metrics that can be tested.
Part 2 will require the auth-backends upgrade to actually make the user_id available via social-auth. But this upgrade requires the following:
user_idscope.ARCH-603