mirror of
https://github.com/bitwarden/server.git
synced 2025-02-22 02:51:33 +01:00
Remove referer header match from middleware (#928)
This commit is contained in:
parent
209b6a8ef9
commit
8c7e7d1f6b
@ -25,16 +25,6 @@ namespace Bit.Sso.Utilities
|
||||
return true;
|
||||
}
|
||||
|
||||
// Determine if the Authority matches the Referrer (short-cut)
|
||||
var referrer = context.Request.Headers["Referer"].FirstOrDefault();
|
||||
if (!string.IsNullOrWhiteSpace(referrer) &&
|
||||
Uri.TryCreate(options.Authority, UriKind.Absolute, out var authorityUri) &&
|
||||
Uri.TryCreate(referrer, UriKind.Absolute, out var referrerUri) &&
|
||||
(referrerUri.IsBaseOf(authorityUri) || authorityUri.IsBaseOf(referrerUri)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Parse out the message
|
||||
|
@ -32,20 +32,6 @@ namespace Bit.Sso.Utilities
|
||||
return true;
|
||||
}
|
||||
|
||||
// Determine if the Authority matches the Referrer (short-cut)
|
||||
var referrer = context.Request.Headers["Referer"].FirstOrDefault();
|
||||
if (!string.IsNullOrWhiteSpace(referrer) &&
|
||||
Uri.TryCreate(referrer, UriKind.Absolute, out var referrerUri) &&
|
||||
(referrerUri.IsBaseOf(idp.SingleSignOnServiceUrl) ||
|
||||
idp.SingleSignOnServiceUrl.IsBaseOf(referrerUri) ||
|
||||
referrerUri.IsBaseOf(idp.SingleLogoutServiceUrl) ||
|
||||
idp.SingleLogoutServiceUrl.IsBaseOf(referrerUri) ||
|
||||
referrerUri.IsBaseOf(idp.SingleLogoutServiceResponseUrl) ||
|
||||
idp.SingleLogoutServiceResponseUrl.IsBaseOf(referrerUri)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// We need to pull out and parse the response or request SAML envelope
|
||||
XmlElement assertion = null;
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user