Commit Graph

316 Commits

Author SHA1 Message Date
Usama Sadiq
d540688f8e refactor: Ran pyupgrade on openedx/core/djangoapps/user_authn 2021-04-07 18:54:33 +05:00
Robert Raposa
96be45f1bd Merge pull request #27222 from edx/robrap/ARCHBOM-1721-toggle-doc-cleanup
ARCHBOM-1721: docs: update toggle docs
2021-04-05 10:47:55 -04:00
Feanil Patel
ba4d98898e Merge pull request #27231 from edx/feanil/more_safe_sessions_updates
fix: Reduce safe-sessions false alarms.
2021-04-02 14:45:22 -04:00
Feanil Patel
c45ffd7509 test: Test login redirects prefer session cookies.
Add a test to ensure that the login page redirect as long as we have a
valid session even if we have expired on non-existent JWT cookies.
2021-04-02 14:19:10 -04:00
Feanil Patel
118f095110 fix: Assume logged in if user has a valid session.
Previously they also had to have a valid JWT cookie which led to a weird
corner case where a user was logged in but still showed the login form
resulting in some confusion and odd behavior.

This change gives precedence to the session token to determine whether
or not someone is logged into the LMS but ensures that if you go through
the login flow, you refresh your JWT cookies. This should not cause any
breakage for MFE flows that might redirect to the LMS login page since
the JWT would get refreshed if it's out of date but the session is
valid.
2021-04-02 14:19:10 -04:00
Robert Raposa
8ef8b35a54 docs: update toggle docs
A variety of updates were made to improve the toggle documentation:
* Added comments to help ensure that the waffle(), waffle_switches(),
  waffle_flags() anti-pattern won't be contagious (copied).
* Some minor toggle_description updates.
* Removed empty toggle_target_removal_date annotations for
  non-temporary toggles.
* Removed empty optional toggle_warnings annotations.
* Removed empty optional toggle_tickets annotations.
* Removed deprecated toggle_category, toggle_status,
  and toggle_expiration_date annotations.
* Fixed some indents, use cases, and implementations.

ARCHBOM-1721
2021-04-01 21:58:29 -04:00
adeelehsan
c329de3235 skip hinted login field added in tpa context 2021-04-01 01:16:54 +05:00
Waheed Ahmed
b200699fc6 Keep user on FE if there is a running pipeline for SAML IDPs.
For some SAML providers, learners are redirected to MFE and breaking
the flow. Check for running pipeline and if the provider is a SAML
provider keep them on FE.

VAN-425
2021-03-25 18:43:19 +05:00
Zainab Amir
8cc5f13daf Add rate limit to registration endpoint (#27060)
Currently the registration endpoint has no rate limit. Added a new ratelimit
variable to support the change, it's value is set to 60/7d.

VAN-302
2021-03-25 16:28:30 +05:00
Waheed Ahmed
e3406257fe Fix edxloggedin cookie not present issue.
If edxloggedin cookie is not present but the user is authenticated;
user is redirected to authn MFE and then back to dashboard instead
of the desired redirect URL (e.g. finish_auth) resulting in learners
not enrolling into the courses.

VAN-415
2021-03-24 16:26:31 +05:00
Waheed Ahmed
4af767e0fb Fix finish auth url for MFE
Currently extra query params are not being handled in get TPAContextView,
Fixed using already available get_next_url_for_login_page().

VAN-415
2021-03-18 19:19:14 +05:00
Zainab Amir
3cdbb5b36a Track total time it takes users to register (#27020)
Added a new property in edx.bi.user.account.registered event to
track total time it took the user to register.

VAN-413
2021-03-18 13:02:12 +05:00
Stu Young
5107aa41e9 DENG-803: add traits to segment context for enrollment activated events (#26842)
add traits to segment context for enrollment activated events
2021-03-16 14:28:22 -04:00
Michael Terry
c697acec2b Merge pull request #26927 from edx/mikix/ace-braze
feat: update to edx-ace 1.0.0
2021-03-12 11:05:30 -05:00
Michael Terry
570a869bd3 feat: update to edx-ace 1.0.0
The new version switches how you specify recipients, to use
lms_user_id instead of usernames.

AA-489
2021-03-12 10:25:54 -05:00
Adeel Khan
725cd3f083 Fix button/title text for;
1) Account activation email.
2) Password reset email.
3) Password reset success.

VAN-272
2021-03-10 00:47:49 +05:00
Zainab Amir
a39befb548 VAN-113: Add error code for registration workflow (#26821) 2021-03-08 18:09:26 +05:00
Adeel Khan
231dd68f90 Make button style primary
VAN-274
2021-03-04 07:50:09 +05:00
Zainab Amir
11791e25d4 VAN-367: Track optional and goals field usage (#26779) 2021-03-02 14:26:44 +05:00
Zainab Amir
773810e176 VAN-367: Capture optional fields usage (#26775) 2021-03-01 13:03:07 +05:00
Adeel Khan
d9ec42c425 Add throttling to validate token and reset password end points
VAN-312
2021-02-24 06:47:18 +05:00
Aarif
4ef7d63211 replaced unittest assertions pytest assertions (#26571) 2021-02-22 20:03:33 +05:00
Aarif
774caac305 replaced unittest assertions pytest assertions (#26513) 2021-02-18 18:07:46 +05:00
Zainab Amir
c260f72c2e VAN-311: Add multiple enterprise support for Authn MFE (#26526) 2021-02-18 17:24:44 +05:00
Feanil Patel
7840c1f248 Merge pull request #26487 from edx/feanil/remove_django_ratelimit_backend
refactor Replace django-ratelimit-backend with django-ratelimit
2021-02-16 11:16:13 -05:00
Awais Qureshi
d7dc8de053 BOM-1437
Fixing tests which were failing on running alone.
Main root cause was the mongodb client connection error.
On running all tests this mongodb connection establishes by some other test.
2021-02-16 10:35:59 +05:00
Feanil Patel
6fb93463a8 refactor Replace django-ratelimit-backend with django-ratelimit
We use django-ratelimit to limit per IP login attempts, and then we use
django-ratelimit-backend to limit per username login attempts. This
change replaces the usage of django-ratelimit-backend with another
instance of django-ratelimit so that both limits can be managed by one
library.

This is the first step in being able to fully excise
django-ratelimit-backend from edx-platform. Note that we're still using
the `RateLimitMixin` in openedx/core/djangoapps/oauth_dispatch/dot_overrides/backends.py
because studio and the admin UI still relies on that for rate limiting.
Those login paths will have to be updated before we can remove the mixin
from our auth backend.
2021-02-12 09:52:13 -05:00
Feanil Patel
14e11cad3d Merge pull request #26460 from edx/feanil/always_squelch
feat: Update the user_authn app to not log PII by default.
2021-02-10 13:58:04 -05:00
Feanil Patel
62c0aa4917 feat: Update the user_authn app to not log PII by default.
Instead of optionally not logging usernames and emails, do so by
default.  This mostly removes some complexity from the app and is makes
it so that it's more secure by default.

I considered the question of allowing people to log usernames and
e-mails if they wanted to but opted not to for a couple of reasons:

* It would involve adding a new feature flag that would be the opposite
of the SQUELCH_PII_IN_LOGS which would be a bit confusing.  When do you
use which one? or do you need both? etc.
* There is still a way to correlate the messages to eachother and in
most cases also to a specific user(email being the exception).
2021-02-10 10:14:58 -05:00
Waheed Ahmed
5c9c6176b6 Add skip_authn_mfe query param option.
Added to serve old login/register pages for the e2e tests
until new tests added or old ones are fixed for the Authn MFE.
2021-02-10 19:17:46 +05:00
Adeel Ehsan
59bc5072cd Merge pull request #26459 from edx/aehsan/van-351/field_added_in_validate_decisions_for_authn
field added in validate decisions for authn
2021-02-10 01:14:21 +05:00
adeelehsan
bcfe2874fc field added in validate decisions for authn
VAN-351
2021-02-10 00:44:10 +05:00
Feanil Patel
cd3e4353b1 feat: Add a 403 and 429 handler.
See context here: https://django-ratelimit.readthedocs.io/en/latest/cookbook/429.html#context

For now we continue to fall back to django's default 403 handler for 403
but provide a new 429 template that we use for ratelimit exceptions.

This commit also updates a logistration test that relied on the old 403
behavior of django-ratelimit instead of the newly added 429 behavior.
2021-02-08 14:03:26 -05:00
Usama Sadiq
90666a6231 Merge pull request #26311 from edx/usamasadiq/bom-2305-pylint-amnesty
Applied pylint-amnesty
2021-02-08 18:23:34 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
uzairr
d86550e1a3 reset-password-success-email 2021-02-06 15:41:56 +05:00
Waheed Ahmed
335915a933 Fix failed attempts and lockout messages for MFE.
VAN-342
2021-02-05 19:37:20 +05:00
Waheed Ahmed
38187de0f9 Authn MFE: Toggle for microfrontend redirect.
VAN-308
2021-02-04 18:58:58 +05:00
Jawayria
9ecbe15d91 BOM-2329: Applied pylint-amnesty to system_wide_roles, theming, user_api, user_authn 2021-02-04 18:00:51 +05:00
adeelehsan
55d2a4f897 Logistration MFE renamed to authn
VAN-300
2021-01-29 11:37:54 +05:00
Waheed Ahmed
f6287694ae Keep enterprise user on monolith FE.
If an enterprise customer is associated with the request,
keep the user on the monolith FE and do not redirect them to
MFE.

VAN-125
2021-01-22 17:01:00 +05:00
Jayram
5a9e12dd96 [ADD] user account registration endpoint for api-docs
Added alias for /user_api endpoints

FIX quality violations

IMPROVED urls_common for readability

Removed redundant URL entry from urls_common file
2021-01-15 03:59:16 +00:00
Tobias Macey
50bb70298c Added a configuration flag to force third party auth (#24789)
This adds a toggle to allow operators to prevent user registration and login via username/password authentication, forcing the platform to only support login and registration using third-party auth such as SAML.

Co-authored-by: Umar Asghar <mrumarasghar@gmail.com>
2021-01-07 09:55:27 -05:00
Zainab Amir
aa3119e4d7 Add new relic metrics (#26003) 2021-01-07 18:08:09 +05:00
Zainab Amir
d5c9536f0a send in-active user details on auth failure (#25931) 2021-01-05 10:33:04 +05:00
srwang
b95739c153 Merge pull request #25888 from edx/swang/ws-1591
WS-1591: change Prospectus user dropdown to show avatar instead of username
2020-12-16 13:40:30 -05:00
Sharon Wang
70cf6ddbf8 fix lint error 2020-12-16 13:16:50 -05:00
Sharon Wang
8889180b59 code review comments and lint 2020-12-16 09:45:31 -05:00
Sharon Wang
88b838f608 exception for profile 2020-12-16 08:58:25 -05:00
Waheed Ahmed
5fce6c28d7 Add logs around all password reset requests.
VAN-192
2020-12-16 15:30:39 +05:00