mirror of
https://github.com/bitwarden/server.git
synced 2024-12-27 17:47:37 +01:00
Update ACS path to embed Organization ID (#955)
This commit is contained in:
parent
3b8cbe631f
commit
a74778de3a
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user