public static bool Matches(this IOpenIdConnectRequestOptions openIdConnectRequestOptions, IOpenIdConnectRequest openIdConnectRequest) { var grantType = openIdConnectRequest.GetGrantType(); var path = openIdConnectRequestOptions.ProtectedPath; if (string.IsNullOrEmpty(grantType) || string.IsNullOrEmpty(path)) { return(false); } return(path.Equals(openIdConnectRequest.GetPath(), StringComparison.OrdinalIgnoreCase) && openIdConnectRequestOptions.ProtectedGrantTypes.Contains(grantType)); }