Skip to content

SSO enforcement: Respect Admin Mode & always apply to private resources

Bogdan Denkovych requested to merge bdenkovych-fix-SSO-enforcement into master

What does this MR do and why?

Closes #404564 (closed)

When Enforce SSO-only authentication for web activity for this group is enabled, this MR:

Since !102104 (merged) and !114111 (merged) SSO enforcement is not applied when non-members or not signed-in users access public groups or projects. While reviewing those MRs, we noticed an inconsistency between accessing private groups and private projects, see this thread !114111 (comment 1333808828).

As per the current state of the SSO enforcement table

Project/Group visibility Enforce SSO setting Member with identity Member without identity Non-member or not signed in
Private Off Enforced Not enforced No access
Private On Enforced Enforced No access

SSO enforcement shouldn't be applied to non-members or not signed in users for private resources. As per the thread !116570 (comment 1339685424), it is not the behavior we want. SSO enforcement should always be applied when a non-member or not signed in user visits a private resource so that they will be redirected to the SSO page of the group instead of /users/sign_in or not found pages.

"No access" - Default behavior: Not found page or redirect to /users/sign_in; SSO enforcement is not applied.

"Enforced" - Redirects to the SSO page of the group. SSO enforcement is applied.

Currently, when

  • non-members access
    • private group, they see not found page
    • private project, they are redirected to the SSO page of the group
  • not signed-in users access
    • private group, they are redirected to /users/sign_in page
    • private project, they are redirected to the SSO page of the group

The behavior should be consistent for groups and projects.

As per the SSO enforcement table documentation updates in this MR, we could say that "SSO enforcement" should always be applied to group members or private resources. This MR aligns and refactors the implementation to reflect this. It aligns policy definition related to SSO enforcement in ee/app/policies/ee/group_policy.rb, ee/app/policies/ee/project_policy.rb, and SSO enforcement table in the docs to ease future refactorings like #378400.

Related to MRs: !102104 (merged), !114111 (merged)

Related to issues #378928 (closed), #386920 (closed)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Bogdan Denkovych

Merge request reports