diff --git a/bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs b/bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs index 624e0f575..7affbc3bf 100644 --- a/bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs +++ b/bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs @@ -18,7 +18,8 @@ namespace Bit.Portal.Models { public SsoConfigDataViewModel() { } - public SsoConfigDataViewModel(SsoConfigurationData configurationData, GlobalSettings globalSettings) + public SsoConfigDataViewModel(SsoConfigurationData configurationData, GlobalSettings globalSettings, + Guid organizationId) { ConfigType = configurationData.ConfigType; Authority = configurationData.Authority; @@ -30,7 +31,7 @@ namespace Bit.Portal.Models RedirectBehavior = configurationData.RedirectBehavior; GetClaimsFromUserInfoEndpoint = configurationData.GetClaimsFromUserInfoEndpoint; SpEntityId = configurationData.BuildSaml2ModulePath(globalSettings.BaseServiceUri.Sso); - SpAcsUrl = configurationData.BuildSaml2AcsUrl(globalSettings.BaseServiceUri.Sso); + SpAcsUrl = configurationData.BuildSaml2AcsUrl(globalSettings.BaseServiceUri.Sso, organizationId.ToString()); IdpEntityId = configurationData.IdpEntityId; IdpBindingType = configurationData.IdpBindingType; IdpSingleSignOnServiceUrl = configurationData.IdpSingleSignOnServiceUrl; diff --git a/bitwarden_license/src/Portal/Models/SsoConfigEditViewModel.cs b/bitwarden_license/src/Portal/Models/SsoConfigEditViewModel.cs index 7d993a1eb..e2ad77d3f 100644 --- a/bitwarden_license/src/Portal/Models/SsoConfigEditViewModel.cs +++ b/bitwarden_license/src/Portal/Models/SsoConfigEditViewModel.cs @@ -41,7 +41,7 @@ namespace Bit.Portal.Models configurationData = new SsoConfigurationData(); } - Data = new SsoConfigDataViewModel(configurationData, globalSettings); + Data = new SsoConfigDataViewModel(configurationData, globalSettings, ssoConfig.OrganizationId); BuildLists(i18nService); } diff --git a/bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs b/bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs index 7ea586815..be64d9741 100644 --- a/bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs +++ b/bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs @@ -340,7 +340,7 @@ namespace Bit.Core.Business.Sso var spOptions = new SPOptions { EntityId = spEntityId, - ModulePath = config.BuildSaml2ModulePath(), + ModulePath = config.BuildSaml2ModulePath(null, name), NameIdPolicy = new Saml2NameIdPolicy(allowCreate, GetNameIdFormat(config.SpNameIdFormat)), WantAssertionsSigned = config.SpWantAssertionsSigned, AuthenticateRequestSigningBehavior = GetSigningBehavior(config.SpSigningBehavior), diff --git a/src/Core/Models/Data/SsoConfigurationData.cs b/src/Core/Models/Data/SsoConfigurationData.cs index aa71ec6df..3f85b2da9 100644 --- a/src/Core/Models/Data/SsoConfigurationData.cs +++ b/src/Core/Models/Data/SsoConfigurationData.cs @@ -50,14 +50,15 @@ namespace Bit.Core.Models.Data return BuildSsoUrl(_oidcSignedOutPath, ssoUri); } - public string BuildSaml2ModulePath(string ssoUri = null) + public string BuildSaml2ModulePath(string ssoUri = null, string scheme = null) { - return BuildSsoUrl(_saml2ModulePath, ssoUri); + return string.Concat(BuildSsoUrl(_saml2ModulePath, ssoUri), + string.IsNullOrWhiteSpace(scheme) ? string.Empty : $"/{scheme}"); } - public string BuildSaml2AcsUrl(string ssoUri = null) + public string BuildSaml2AcsUrl(string ssoUri = null, string scheme = null) { - return string.Concat(BuildSaml2ModulePath(ssoUri), "/Acs"); + return string.Concat(BuildSaml2ModulePath(ssoUri, scheme), "/Acs"); } private string BuildSsoUrl(string relativePath, string ssoUri)