Respect User.is_active when logging in with SAML SSO.
Review Request #14331 — Created Feb. 6, 2025 and submitted
When we built the SSO support, we made the assumption that all user
management would happen on the IdP side. We've had a report of a user
that wants to connect their IdP generally, but selectively mark users as
active or not on the Review Board side.This change makes it so the SAML ACS and link-user views check the
is_active
flag. In the link-user flow, we rely on the authentication
view/form to show the same error that someone would get if they were
logging in with a username and password. In the ACS flow, we just
redirect to a permission denied page.While writing tests for this, things were getting a little unwieldy, so
I split up the SAML view tests into separate classes.
- Set my user account to inactive and tried to log in with SAML. Saw
that things worked as expected. - Ran unit tests.
Summary | ID |
---|---|
b39328342a3e5456f66b3ed0b2ba8e3a3e3bef41 |
Description | From | Last Updated |
---|---|---|
'reviewboard.accounts.models.LinkedAccount' imported but unused Column: 1 Error code: F401 |
![]() |
|
expected 2 blank lines, found 1 Column: 1 Error code: E302 |
![]() |
|
expected 2 blank lines, found 1 Column: 1 Error code: E302 |
![]() |
|
Since they're targeting a 7.0.3 upgrade, I'm tempted to say let's just target 7.0.4 for this. |
|
|
We should be localizing the errors. |
|
|
Doesn't this type to forms.BooleanField automatically? |
|
- Commits:
-
Summary ID f75190d7dd73cc53abac84e7886a9bc2be5935fc 9e050bf8dd4f42eb0a76fe42a9ce2c6857567aed - Diff:
-
Revision 2 (+554 -100)
Checks run (2 succeeded)
- Commits:
-
Summary ID 9e050bf8dd4f42eb0a76fe42a9ce2c6857567aed b39328342a3e5456f66b3ed0b2ba8e3a3e3bef41 - Diff:
-
Revision 3 (+560 -100)