# Feature OP-20046 - Allow restricting password login for SSO authenticated users

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-20046

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 17.9.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Authentication, DevSecOps / Security |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan | Enterprise / Professional (PRO) |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Developers | Klaus Zanders |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As a** system administrator running OpenProject with SSO  
**I want to** control who may sign in with an internal username/password  
**so that** users linked to an identity provider cannot bypass SSO with a leftover password, while still allowing break-glass access when needed

**Acceptance criteria**

  - A new Password login policy is available under *Administration → Authentication → Login and registration → Single Sign-On (SSO)* with three modes:
    
      - Allow for everyone (`all`, default)
        
          - *this matches the current behaviour without any env*
    
      - Disallow for SSO users (`except_sso`)
        
          - *users linked to an OmniAuth provider cannot authenticate with an internal/LDAP password; fixes the reported bug when this mode is enabled*
    
      - Disallow for everyone (`none`)
        
          - *password form hidden on* `_/login_`*; only allowlisted principals may use a password*

  - In `except_sso` and `none`, administrators can configure Users and groups who may still use a password (break-glass allowlist)
    
      - selecting groups there will result in child groups to be included as well

  - `/login/internal` remains available for break-glass password login when direct SSO login is configured and/or when mode is `none` and an allowlist (or env login overlay) exists

  - Password authentication, password changes, lost-password flows, and LDAP admin are blocked according to the active policy

  - Legacy `OPENPROJECT_DISABLE__PASSWORD__LOGIN=true` (and `disable_password_login` in configuration) maps to mode `none` and locks the UI setting.
    
      - A note is added so that configurations should prefer `OPENPROJECT_PASSWORD__LOGIN`

  - When settings are provided via environment/configuration, the admin UI shows a banner listing non-editable settings

  - Deleting a user or group removes them from the break-glass allowlist automatically

  - If no SSO provider is enabled, password-login restriction controls are disabled with an explanatory warning

**Technical notes**

  - Original work package: <mention class="mention" data-id="61159" data-type="work_package" data-text="##SC-99" data-display-id="SC-99">\#\#SC-99</mention>

**Permissions and visibility considerations**

  - *To whom is this feature visible?*  
     Administrators with access to *Authentication* settings (Enterprise for the SSO UI tab). End users see effects on login (hidden password form, blocked login, `/login/internal` when applicable).

  - *When is it not visible?*  
     When no SSO provider is configured (controls disabled + warning). When settings are env-locked (shown read-only with banner). LDAP connections menu hidden when password login is fully disabled (`none`). Password-related admin settings disabled in `none` mode.

**Out of scope**

  - Full dual-mode UX where SSO-linked users can actively manage, recover, and use passwords alongside SSO (the “non-simple” option from the original report)

  - Changing OmniAuth account-remapping behaviour (`oauth_allow_remapping_of_existing_users`)

  - Restricting API/basic-auth or non-password authentication mechanisms

  - Auto-enabling `except_sso` on existing instances (default remains `all`)
