Commit Graph

79 Commits

Author SHA1 Message Date
Nizar Mahmoud
4cb4be6afe feat: associates user by email for oauth when tpa is required
This change associates users signing in using oauth providers when tpa is required, verifying that only a single database user is associated with the email.

For more information as to why this was added in a separate pipeline, check edx-platform#25935.
2021-04-02 11:32:58 +05:00
Awais Qureshi
81bab4d01a Pyupgrade in common/djangoapps/third-party-auth/tests. 2021-03-19 15:39:48 +05:00
Aarif
e6a0d35009 replaced unittest assertions pytest assertions (#26240) 2021-02-12 12:31:37 +05:00
Jawayria
7be5a683aa Applied pylint-amnesty to third_party_auth 2021-02-03 13:37:05 +05:00
Zainab Amir
d5c9536f0a send in-active user details on auth failure (#25931) 2021-01-05 10:33:04 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
uzairr
c68155f76f Modify the api response
Update the api response so that it cannot contain the response
in the form of HTML which may prove vulnerable for MFE in future.

VAN-14
2020-09-10 12:39:09 +05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Robert Raposa
3505492fff require POST for login_user
ARCH-1253
2019-12-15 11:20:06 -05:00
Robert Raposa
d79e7df32b use login_ajax for logistration
- use login_ajax (in place of login_session with shim) for
logistration's call to login POST
- add toggle for using login_ajax from logistration
  - FEATURES['ENABLE_LOGIN_POST_WITHOUT_SHIM']
- add custom metrics for redirect_url
- update test for third-party auth error_code

NOTE: The error_code `third-party-auth-with-no-linked-account`
was introduced in JSON in this earlier PR:
https://github.com/edx/edx-platform/pull/22452/files

ARCH-1253
2019-12-12 10:39:49 -05:00
Zainab Amir
7eb21f4dec Change version of social-auth-app-django (#21956)
Microsoft social login is not working on edx mobile app. The issue
is fixed in newer version of social-auth-app-django.

PROD-718
2019-12-12 18:07:34 +05:00
Robert Raposa
9e4706e7bb remove UPDATE_LOGIN_USER_ERROR_STATUS_CODE toggle
The toggle UPDATE_LOGIN_USER_ERROR_STATUS_CODE was added to roll out a
breaking change for `login_user` auth errors to return a 400 rather than
a 200.

This toggle was enabled in Production on 12/5/2019 with seemingly no
adverse affects.

ARCH-1253
2019-12-06 17:20:17 -05:00
Diana Huang
e026006f9a Move RegistrationView from user_api to user_authn. 2019-11-01 07:41:48 -04:00
Nimisha Asthagiri
db42c7e1e2 User Authn: Remove deprecated, ENABLE_COMBINED_LOGIN_REGISTRATION 2019-10-29 08:57:58 -04:00
Nimisha Asthagiri
8cfc33c0f1 Python 3: multi-line regex replacement of assertIn and assertNotIn 2019-09-30 08:51:02 -04:00
Nimisha Asthagiri
e5c258948d third_party_auth python-3 upgrade 2019-09-28 12:42:51 -04:00
Feanil Patel
f259a911c7 BOM-618 Decode content we get from test requests. 2019-09-19 10:32:23 -04:00
David Ormsbee
9a1385585f Convert response bytes to str before JSON parsing. (#21375)
Convert response bytes to str before JSON parsing.
2019-08-19 11:01:55 -04:00
amitvadhel
8ef8dd27b2 INCR-139: Run python-modernize on common/djangoapps/third_party_auth/tests [tests, data] 2019-05-10 12:54:01 +03:00
Waheed Ahmed
3bdf83dba7 Update third party auth login page message.
LEARNER-5258
2019-04-17 15:20:38 +05:00
Matthew Piatetsky
9681ca36b8 fix unicode strings in common/ 2019-02-05 10:57:00 -05:00
Nimisha Asthagiri
f840774169 Fix Studio SSO
ARCH-329
2018-12-22 22:48:46 -05:00
Gabe Mulley
5311509b19 Provide more context to calls to Segment.
Implementation for DE-1089.

Centralize the definition of context into a single method.  This is in
common/djangoapps/track because the context is originally set there by
middleware.
2018-11-15 20:56:10 -05:00
Waheed Ahmed
bf5ad9b871 Update session cookie expiry.
Update session cookie expiry to 4 weeks regardless of remember me
checkbox is checked or not.

LEARNER-6219
2018-11-14 17:36:51 +05:00
Dillon Dumesnil
0a0df72fc9 Cleaning up unicode waffle flag 2018-10-19 13:25:08 -04:00
Nimisha Asthagiri
8cf44283c9 Consolidate user login and authentication code 2018-09-15 03:21:39 -04:00
asadiqbal
0dbdac3262 Unlink learner from Enterprise Customer when learner unlinks from IDP 2018-09-04 11:07:53 +05:00
Jeremy Bowman
69092ac18b Fix unit tests with latest social-auth-* packages 2018-06-13 17:24:33 -04:00
Michael Youngstrom
26b4e30833 Remove django 1.8 shim 2018-06-06 10:34:56 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
John Hensley
c7c01e4a22 Fix user creation management commands
Two user creation scripts were broken by the move of
student.views._do_create_account to student.helpers.do_create_account.

This patch just catches the scripts up.
2018-02-14 11:32:26 -05:00
bmedx
1d45c85135 Refactor student login for readability and fix Django 1.11 issues 2018-01-24 11:26:43 -05:00
John Eskew
1504c098a9 Form expected test redirect urls properly. 2018-01-05 14:23:22 -05:00
Saleem Latif
86da9c1c63 Disable linking of personal accounts to enterprise customers via SSO 2017-12-18 15:12:42 +05:00
Sven Marnach
b77bff4d96 Small fixes to support Okta SSO. 2017-11-28 16:50:53 +01:00
Jesse Shapiro
700e8053db Generalize support for user fields from SAP SuccessFactors SSO providers 2017-08-09 13:07:00 -04:00
Uman Shahzad
8b65ca17c5 Migrate to latest, split python-social-auth.
PSA was monolothic, now split, with new features, like
a DB-backed partial pipeline. FB OAuth2 version also upped.

Partial pipelines don't get cleared except when necessary.
They persist for special cases like change of browser while
still mid-pipeline (i.e. email validation step).

Refactor, cleanup, and update of a lot of small things as well.

PLEASE NOTE the new `social_auth_partial` table.
2017-06-20 22:05:36 +05:00
Uman Shahzad
d5c85331c5 Automatically populate additional fields for SSO scenarios.
When authenticating using an SAML IdP, gather additional user
data besides what is standard. Requires admin to input JSON
in settings to recognize the additional user data.
2017-06-18 22:18:43 +00:00
Matt Drayer
5097bd6e54 mattdrayer/ENT-328: Update account activation message on sign-in form. 2017-05-04 10:58:42 -04:00
Jesse Shapiro
ee9f632a3d Allow per-SSO-provider session expiration limits 2017-04-18 09:07:53 -04:00
Clinton Blackburn
4cc7628696 Upgraded to Python Social Auth 0.2.21 to resolve migration issue 2017-03-10 23:06:02 -05:00
Hasnain
2f1d405146 Set 'created_on_site' UserAttribute on account creation.
We need to be able to track which site a given user account was created on. This
change will create a UserAttribute model with a key of 'created_on_site' and a value
containing the domain of the site on which the user accounted was created.

WL-977
2017-02-22 05:12:21 -05:00
Clinton Blackburn
1189867dd2 Removed references to ECOMMERCE_API_SIGNING_KEY
We should not be using custom signing keys for each service at this time. We may want to return to this strategy in the future; but, this is not the direction any of our other services are going in.

ECOM-6541
2017-02-01 01:51:21 -05:00
Jesse Shapiro
fc814aee95 Add data sharing consent features for EnterpriseCustomer 2016-12-12 09:30:38 -05:00
Braden MacDonald
8bf9b188a5 Add optional "debug mode" w/ detailed logging for SAML IdPs 2016-09-06 15:27:45 -07:00
Sylvia Pearce
8b1f28d317 Account registration and activation text string revisions 2016-06-27 13:32:53 -04:00
Calen Pennington
d77025c873 Use a contextmanager to cleanup after manipulating the current request in third_party_auth tests 2016-06-09 10:10:39 -04:00
Ahsan Ulhaq
d31b7cbd68 Complete Order History area for students
ECOM-2361
2016-06-08 21:45:07 +05:00
Hasnain
0971e3715a Added check for duplication of email 2016-01-29 14:01:07 +00:00
Braden MacDonald
40448e44fa Address review comments and test failure 2015-11-16 16:11:00 -08:00