Commit Graph

40 Commits

Author SHA1 Message Date
Usama Sadiq
3e6b3e41f8 refactor: remove unused imports (#27084) 2021-03-24 17:55:04 +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
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
Manjinder Singh
953b0e728b Remove ThirdPartyAuthProviderApiPermission (#23195)
* Remove ThirdPartyAuthProviderApiPermission

Also removed ProviderApiPermissions and ApiPermissionsAdminForm and removal of DOP for third_party_auth

* Removing model

* Replaced long_token with default_token_generator

* Adding skip to test_migrations_are_in_sync
2020-02-27 15:42:09 -05:00
Robert Raposa
372d2e927c BOM-1264: add third-party-auth scope and usage (#23135)
* WIP: add third-party-auth scope and usage

BOM-1264


* Fix tests now that we do permissions in a more standard way.

Rather than manually setting the permission class we previously
explicitly raised a PermissionDenied exception.  The way DRF
permissoning logic works, if we use the WWW-Authenticate header in the
highest priority auth class, it will return a 401 instead of a 403.


* Added test to make sure having permissions gives access to user mapping api

* Test new filters logic.

Ensure that the filters we add to the application access model make it
into the JWT correctly.

* quality fix

* quality fix

* disable pylint warning

* quality fix

* fix indent prob

Co-authored-by: Feanil Patel <feanil@edx.org>
Co-authored-by: Manjinder Singh <49171515+jinder1s@users.noreply.github.com>
2020-02-21 11:25:28 -05:00
David Ormsbee
b134228954 Python upgrades (django-config-models v2)+
Some tests that used to mock the cache internals of ConfigurationModels
had to be modified to use CacheIsolationTestCase instead (the things
they were mocking no longer exist).
2020-02-09 20:37:45 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -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
Calen Pennington
c83d0e2ca8 OverwriteStorage was removed from django-storages, so pull it into edx-platform (for now?) 2019-12-19 14:06:30 -05:00
aarif
ccff822a28 ran python-modernize and isort on files mentioned in INCR-396 2019-07-19 10:04:05 -04:00
Thomas Tracy
f0ecc938ef Add IdentityServer3 Backend (#20275)
* Add IdentityServer3 Backend

This adds a backend for users who want to use IdentityServer3 as their
SSO provider. It can be used with the OAuth2ProviderConfig in django
admin to point to an external provider.
2019-06-07 09:38:46 -04:00
Michael Roytman
14160b919f add LMS endpoint to redirect to identity provider 2019-04-23 17:10:31 -04:00
Hammad Ahmad Waqas
a48b59c24c fixed : when SAML attribute is mapped + present, but has no value 2019-03-21 12:08:50 +05:00
Matthew Piatetsky
9681ca36b8 fix unicode strings in common/ 2019-02-05 10:57:00 -05:00
Jeremy Bowman
3ff3eee2f2 TE-2689 Remove useless pylint suppressions part 4 2018-08-20 12:54:22 -04:00
Brittney Exline
9a86a67ae0 ENT-943 Cleanup of old third_party_auth provider slug fields 2018-04-10 09:58:31 -04:00
Brittney Exline
682ec886ed ENT-943 Refactoring third_party_auth models 2018-04-05 15:19:58 -04:00
Brittney Exline
c4670a33d7 ENT-839 Add ability to configure SP metadata for an IdP 2018-01-30 11:37:46 -05:00
John Eskew
1504c098a9 Form expected test redirect urls properly. 2018-01-05 14:23:22 -05:00
zubair-arbi
d7502acc5b ENT-768
display friendly error message for saml rejection
2017-12-22 15:12:11 +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
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Jesse Shapiro
da3867e870 Enable direct calls to SAP SuccessFactors OData API to fetch user data during SSO process 2017-04-06 10:31:01 -04:00
Brandon DeRosier
3dcf689ee2 Implement Site settings for Third Party Auth providers 2016-09-26 12:43:00 -04:00
Omar Khan
793bb0f1e9 Custom icons for third party auth login buttons
- Icon images can be uploaded from the django admin
- Test coverage improved
2016-04-01 08:57:43 +07:00
Braden MacDonald
ee444ed67f Enable Azure AD third party auth provider by default 2016-03-29 15:24:00 -07:00
Braden MacDonald
40448e44fa Address review comments and test failure 2015-11-16 16:11:00 -08:00
Braden MacDonald
f1bfa56884 Clean up integration tests, test logging in without activation 2015-11-16 16:11:00 -08:00
Pan Luo
f69304373c Implement user mapping API
This mapping API enables the mapping between the edX user ID and the ID
provided by identity provider (IdP). For details, please see
https://github.com/edx/edx-platform/pull/9842
2015-10-27 15:19:42 -07:00
William Ono
4d1194800e Support LTI third-party-auth providers
PR #8930
2015-09-03 22:53:45 -07:00
Braden MacDonald
586c237543 Fix for Twitter compatibility 2015-08-27 11:19:39 -07:00
Braden MacDonald
f776b81853 Make email addresses in SAML metadata fully configurable 2015-07-29 14:48:31 -07:00
Braden MacDonald
cd941eada7 New SAML/Shibboleth tests - PR 8518 2015-06-26 13:24:00 -07:00
Braden MacDonald
b4904adc1e Use ConfigurationModels for third_party_auth, new metadata fetching - PR 8155 2015-06-26 13:23:59 -07:00
Will Daly
9e9dec1de1 Integrate third party auth into the combined login/registration page.
Change third party auth login failure code to a 401, to detect authentication
success with no linked account.

If already authenticated, redirect immediately to the dashboard.

Use "Location" header correctly for 302 redirects from student views.

Add utility functions for simulating a running third-party auth pipeline.

Add a utility function for checking whether third party auth is enabled.

Respect default values sent by the server
2014-10-22 17:10:49 -04:00
Will Daly
d558a36127 Fix unit test failures due to duplicate url names
Reset the correct URLs module to fix test failures.

Fix third party auth to reconfigure the registry on test cleanup.
2014-10-20 09:10:11 -04:00
John Cox
ce0b640712 Add third-party auth implementation and tests 2014-04-25 12:11:20 -07:00
John Cox
8ecfa8679a Add common/djangoapps/third_party_auth; update pylintrc to allow test_* names.
third_party_auth contains a working settings mechanism, the start of the provider interface + 3 implementations (Google, Mozilla Persona, LinkedIn), and a stub for the auth pipeline. Modified existing lms settings files to use but deactivate the module.
2014-03-06 17:20:58 -08:00