Skip to content

feat: Add disable_password_login configuration to support SSO-only authentication - #13151

Merged
yingfeng merged 9 commits into
infiniflow:mainfrom
Attili-sys:disable_login_form
Mar 2, 2026
Merged

yingfeng merged 9 commits into
infiniflow:mainfrom
Attili-sys:disable_login_form

Conversation

@ahmadintisar

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Enterprise deployments that use an external Identity Provider (e.g., Microsoft Entra ID, Okta, Keycloak) need the ability to enforce SSO-only authentication by hiding the email/password login form. Currently, the login page always shows the password form alongside OAuth buttons, with no way to disable it.

This PR adds a disable_password_login configuration option under the existing authentication section in service_conf.yaml. When set to true, the login page only displays configured OAuth/SSO buttons and hides the email/password form, "Remember me" checkbox, and "Sign up" link.

The flag can be set via:

  • service_conf.yaml (authentication.disable_password_login: true)
  • Environment variable (DISABLE_PASSWORD_LOGIN=true)

Default behavior is unchanged (false).

Behavior

disable_password_login OAuth configured Result
false (default) No Standard email/password form
false Yes Email/password form + SSO buttons below
true Yes SSO buttons only (no form, no sign up link)
true No Empty card (admin should configure OAuth first)

Type of change

  • New Feature (non-breaking change which adds functionality)

Files changed (5)

  1. docker/service_conf.yaml.template — added disable_password_login: false under authentication
  2. common/settings.py — added DISABLE_PASSWORD_LOGIN global variable and loader in init_settings()
  3. common/config_utils.py — fixed TypeError in show_configs() when authentication section contains non-dict values (e.g., booleans)
  4. api/apps/system_app.py — exposed disablePasswordLogin flag in /config endpoint
  5. web/src/pages/login/index.tsx — conditionally render password form based on config flag; OAuth buttons always render when channels exist

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. 🌈 python Pull requests that update Python code 💞 feature Feature request, pull request that fullfill a new feature. 🧰 typescript Pull requests that update Typescript code labels Feb 15, 2026
@ahmadintisar

Copy link
Copy Markdown
Contributor Author

Hi Team,

It's been a couple of days and my PR hasn't been reviewed. I also don't see an option to add a reviewer manually.
Your response would be appreciated.

@ahmadintisar

Copy link
Copy Markdown
Contributor Author

Comment thread docker/service_conf.yaml.template Resolved
@KevinHuSh KevinHuSh added the ci Continue Integration label Feb 25, 2026
@KevinHuSh
KevinHuSh marked this pull request as draft February 25, 2026 06:23
@KevinHuSh
KevinHuSh marked this pull request as ready for review February 25, 2026 06:23
@codecov

codecov Bot commented Feb 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.18%. Comparing base (a897aed) to head (566b965).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13151      +/-   ##
==========================================
+ Coverage   47.15%   47.18%   +0.03%     
==========================================
  Files          44       44              
  Lines        9740     9740              
  Branches      110      110              
==========================================
+ Hits         4593     4596       +3     
+ Misses       5134     5131       -3     
  Partials       13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ahmadintisar

Copy link
Copy Markdown
Contributor Author

@KevinHuSh can you please review? I see the latest test case failed, it says in common.settings Disable form is not declared, but it is declared. Can you review pls :)

@yingfeng

Copy link
Copy Markdown
Member

@KevinHuSh can you please review? I see the latest test case failed, it says in common.settings Disable form is not declared, but it is declared. Can you review pls :)

It does cause the CI failure, please fix it, thanks~~

@ahmadintisar

Copy link
Copy Markdown
Contributor Author

@KevinHuSh can you please review? I see the latest test case failed, it says in common.settings Disable form is not declared, but it is declared. Can you review pls :)

It does cause the CI failure, please fix it, thanks~~

CI Update

The original failure (test_get_config_returns_register_enabled_unit) is fixed — the test mock for common.settings was missing the new DISABLE_PASSWORD_LOGIN attribute. Added it to the mock setup and it now passes.

The 2 remaining failures in CI are unrelated to this PR:

  1. test_parse_branches — DocumentService.update_by_id isn't fully mocked, so it attempts a real MySQL connection that doesn't exist in CI. Needs a DB mock added to the test.

  2. test_stop_parsing_branches — Assertion expects the old message "progress at 0 or 1" but the source now returns "Can't stop parsing document that has not started or already completed". The test string just needs updating.

Both of these appear to be pre-existing issues from other merged changes, not from this PR.

@yingfeng
yingfeng merged commit 1843888 into infiniflow:main Mar 2, 2026
1 check passed
guptas6est pushed a commit to Nordix/ragflow that referenced this pull request Mar 5, 2026
…authentication (infiniflow#13151)

### What problem does this PR solve?

Enterprise deployments that use an external Identity Provider (e.g.,
Microsoft Entra ID, Okta, Keycloak) need the ability to enforce SSO-only
authentication by hiding the email/password login form. Currently, the
login page always shows the password form alongside OAuth buttons, with
no way to disable it.

This PR adds a `disable_password_login` configuration option under the
existing `authentication` section in `service_conf.yaml`. When set to
`true`, the login page only displays configured OAuth/SSO buttons and
hides the email/password form, "Remember me" checkbox, and "Sign up"
link.

The flag can be set via:
- `service_conf.yaml` (`authentication.disable_password_login: true`)
- Environment variable (`DISABLE_PASSWORD_LOGIN=true`)

Default behavior is unchanged (`false`).

### Behavior

| `disable_password_login` | OAuth configured | Result |
|---|---|---|
| `false` (default) | No | Standard email/password form |
| `false` | Yes | Email/password form + SSO buttons below |
| `true` | Yes | **SSO buttons only** (no form, no sign up link) |
| `true` | No | Empty card (admin should configure OAuth first) |

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

### Files changed (5)

1. `docker/service_conf.yaml.template` — added `disable_password_login:
false` under authentication
2. `common/settings.py` — added `DISABLE_PASSWORD_LOGIN` global variable
and loader in `init_settings()`
3. `common/config_utils.py` — fixed `TypeError` in `show_configs()` when
authentication section contains non-dict values (e.g., booleans)
4. `api/apps/system_app.py` — exposed `disablePasswordLogin` flag in
`/config` endpoint
5. `web/src/pages/login/index.tsx` — conditionally render password form
based on config flag; OAuth buttons always render when channels exist

---------

Co-authored-by: Ahmad Intisar <[email protected]>
writinwaters pushed a commit to writinwaters/ragflow that referenced this pull request Apr 10, 2026
…authentication (infiniflow#13151)

### What problem does this PR solve?

Enterprise deployments that use an external Identity Provider (e.g.,
Microsoft Entra ID, Okta, Keycloak) need the ability to enforce SSO-only
authentication by hiding the email/password login form. Currently, the
login page always shows the password form alongside OAuth buttons, with
no way to disable it.

This PR adds a `disable_password_login` configuration option under the
existing `authentication` section in `service_conf.yaml`. When set to
`true`, the login page only displays configured OAuth/SSO buttons and
hides the email/password form, "Remember me" checkbox, and "Sign up"
link.

The flag can be set via:
- `service_conf.yaml` (`authentication.disable_password_login: true`)
- Environment variable (`DISABLE_PASSWORD_LOGIN=true`)

Default behavior is unchanged (`false`).

### Behavior

| `disable_password_login` | OAuth configured | Result |
|---|---|---|
| `false` (default) | No | Standard email/password form |
| `false` | Yes | Email/password form + SSO buttons below |
| `true` | Yes | **SSO buttons only** (no form, no sign up link) |
| `true` | No | Empty card (admin should configure OAuth first) |

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

### Files changed (5)

1. `docker/service_conf.yaml.template` — added `disable_password_login:
false` under authentication
2. `common/settings.py` — added `DISABLE_PASSWORD_LOGIN` global variable
and loader in `init_settings()`
3. `common/config_utils.py` — fixed `TypeError` in `show_configs()` when
authentication section contains non-dict values (e.g., booleans)
4. `api/apps/system_app.py` — exposed `disablePasswordLogin` flag in
`/config` endpoint
5. `web/src/pages/login/index.tsx` — conditionally render password form
based on config flag; OAuth buttons always render when channels exist

---------

Co-authored-by: Ahmad Intisar <[email protected]>
JasleenKaurSethi pushed a commit to stackhpc/ragflow that referenced this pull request Apr 28, 2026
…authentication (infiniflow#13151)

### What problem does this PR solve?

Enterprise deployments that use an external Identity Provider (e.g.,
Microsoft Entra ID, Okta, Keycloak) need the ability to enforce SSO-only
authentication by hiding the email/password login form. Currently, the
login page always shows the password form alongside OAuth buttons, with
no way to disable it.

This PR adds a `disable_password_login` configuration option under the
existing `authentication` section in `service_conf.yaml`. When set to
`true`, the login page only displays configured OAuth/SSO buttons and
hides the email/password form, "Remember me" checkbox, and "Sign up"
link.

The flag can be set via:
- `service_conf.yaml` (`authentication.disable_password_login: true`)
- Environment variable (`DISABLE_PASSWORD_LOGIN=true`)

Default behavior is unchanged (`false`).

### Behavior

| `disable_password_login` | OAuth configured | Result |
|---|---|---|
| `false` (default) | No | Standard email/password form |
| `false` | Yes | Email/password form + SSO buttons below |
| `true` | Yes | **SSO buttons only** (no form, no sign up link) |
| `true` | No | Empty card (admin should configure OAuth first) |

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

### Files changed (5)

1. `docker/service_conf.yaml.template` — added `disable_password_login:
false` under authentication
2. `common/settings.py` — added `DISABLE_PASSWORD_LOGIN` global variable
and loader in `init_settings()`
3. `common/config_utils.py` — fixed `TypeError` in `show_configs()` when
authentication section contains non-dict values (e.g., booleans)
4. `api/apps/system_app.py` — exposed `disablePasswordLogin` flag in
`/config` endpoint
5. `web/src/pages/login/index.tsx` — conditionally render password form
based on config flag; OAuth buttons always render when channels exist

---------

Co-authored-by: Ahmad Intisar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration 💞 feature Feature request, pull request that fullfill a new feature. 🌈 python Pull requests that update Python code size:L This PR changes 100-499 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants