1
0
mirror of https://github.com/bitwarden/server synced 2025-12-24 12:13:17 +00:00

[EC-758] Add environment variable to enforce SSO Policy for all users (#2428)

* [EC-758] Add environment variable GlobalSettings.Sso.EnforceSsoPolicyForAllUsers to enforce SSO Policy for all users

* [EC-758] Add integration tests

* [EC-758] Add Entities namespace to resolve ambiguous reference

* [EC-758] dotnet format

* [EC-758] Updated integration tests to check for logins with all user types

* [EC-758] Create new TestServer for each test

* [EC-758] Combine unit tests and refactor to use BitAutoData
This commit is contained in:
Rui Tomé
2022-12-20 13:08:29 +00:00
committed by GitHub
parent d60746d9b1
commit 4adc4b0181
4 changed files with 264 additions and 95 deletions

View File

@@ -368,7 +368,7 @@ public abstract class BaseRequestValidator<T> where T : class
PolicyType.RequireSso);
// Owners and Admins are exempt from this policy
if (orgPolicy != null && orgPolicy.Enabled &&
userOrg.Type != OrganizationUserType.Owner && userOrg.Type != OrganizationUserType.Admin)
(_globalSettings.Sso.EnforceSsoPolicyForAllUsers || (userOrg.Type != OrganizationUserType.Owner && userOrg.Type != OrganizationUserType.Admin)))
{
return false;
}