|
|
@@ -30,24 +30,33 @@ internal sealed class ConfigureClientScopes : IPostConfigureOptions<ApiAuthoriza
|
|
|
{
|
|
|
if (!identityResource.Properties.TryGetValue(ApplicationProfilesPropertyNames.Clients, out var clientList))
|
|
|
{
|
|
|
- _logger.LogInformation(LoggerEventIds.AllowedApplicationNotDefienedForIdentityResource, "Identity resource '{IdentityResourceName}' doesn't define a list of allowed applications.", identityResource.Name);
|
|
|
+ if (_logger.IsEnabled(LogLevel.Information))
|
|
|
+ {
|
|
|
+ _logger.LogInformation(LoggerEventIds.AllowedApplicationNotDefienedForIdentityResource, "Identity resource '{IdentityResourceName}' doesn't define a list of allowed applications.", identityResource.Name);
|
|
|
+ }
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
var resourceClients = clientList.Split(DefaultClientListSeparator, StringSplitOptions.RemoveEmptyEntries);
|
|
|
if (resourceClients.Length == 0)
|
|
|
{
|
|
|
- _logger.LogInformation(LoggerEventIds.AllowedApplicationNotDefienedForIdentityResource, "Identity resource '{IdentityResourceName}' doesn't define a list of allowed applications.", identityResource.Name);
|
|
|
+ if (_logger.IsEnabled(LogLevel.Information))
|
|
|
+ {
|
|
|
+ _logger.LogInformation(LoggerEventIds.AllowedApplicationNotDefienedForIdentityResource, "Identity resource '{IdentityResourceName}' doesn't define a list of allowed applications.", identityResource.Name);
|
|
|
+ }
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if (resourceClients.Length == 1 && resourceClients[0] == ApplicationProfilesPropertyValues.AllowAllApplications)
|
|
|
- {
|
|
|
- _logger.LogInformation(LoggerEventIds.AllApplicationsAllowedForIdentityResource, "Identity resource '{IdentityResourceName}' allows all applications.", identityResource.Name);
|
|
|
- }
|
|
|
- else
|
|
|
+ if (_logger.IsEnabled(LogLevel.Information))
|
|
|
{
|
|
|
- _logger.LogInformation(LoggerEventIds.ApplicationsAllowedForIdentityResource, "Identity resource '{IdentityResourceName}' allows applications '{ResourceClients}'.", identityResource.Name, string.Join(" ", resourceClients));
|
|
|
+ if (resourceClients.Length == 1 && resourceClients[0] == ApplicationProfilesPropertyValues.AllowAllApplications)
|
|
|
+ {
|
|
|
+ _logger.LogInformation(LoggerEventIds.AllApplicationsAllowedForIdentityResource, "Identity resource '{IdentityResourceName}' allows all applications.", identityResource.Name);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _logger.LogInformation(LoggerEventIds.ApplicationsAllowedForIdentityResource, "Identity resource '{IdentityResourceName}' allows applications '{ResourceClients}'.", identityResource.Name, string.Join(" ", resourceClients));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
foreach (var client in options.Clients)
|
|
|
@@ -67,24 +76,33 @@ internal sealed class ConfigureClientScopes : IPostConfigureOptions<ApiAuthoriza
|
|
|
{
|
|
|
if (!resource.Properties.TryGetValue(ApplicationProfilesPropertyNames.Clients, out var clientList))
|
|
|
{
|
|
|
- _logger.LogInformation(LoggerEventIds.AllowedApplicationNotDefienedForApiResource, "Resource '{ApiResourceName}' doesn't define a list of allowed applications.", resource.Name);
|
|
|
+ if (_logger.IsEnabled(LogLevel.Information))
|
|
|
+ {
|
|
|
+ _logger.LogInformation(LoggerEventIds.AllowedApplicationNotDefienedForApiResource, "Resource '{ApiResourceName}' doesn't define a list of allowed applications.", resource.Name);
|
|
|
+ }
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
var resourceClients = clientList.Split(DefaultClientListSeparator, StringSplitOptions.RemoveEmptyEntries);
|
|
|
if (resourceClients.Length == 0)
|
|
|
{
|
|
|
- _logger.LogInformation(LoggerEventIds.AllowedApplicationNotDefienedForApiResource, "Resource '{ApiResourceName}' doesn't define a list of allowed applications.", resource.Name);
|
|
|
+ if (_logger.IsEnabled(LogLevel.Information))
|
|
|
+ {
|
|
|
+ _logger.LogInformation(LoggerEventIds.AllowedApplicationNotDefienedForApiResource, "Resource '{ApiResourceName}' doesn't define a list of allowed applications.", resource.Name);
|
|
|
+ }
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if (resourceClients.Length == 1 && resourceClients[0] == ApplicationProfilesPropertyValues.AllowAllApplications)
|
|
|
- {
|
|
|
- _logger.LogInformation(LoggerEventIds.AllApplicationsAllowedForApiResource, "Resource '{ApiResourceName}' allows all applications.", resource.Name);
|
|
|
- }
|
|
|
- else
|
|
|
+ if (_logger.IsEnabled(LogLevel.Information))
|
|
|
{
|
|
|
- _logger.LogInformation(LoggerEventIds.ApplicationsAllowedForApiResource, "Resource '{ApiResourceName}' allows applications '{resourceClients}'.", resource.Name, string.Join(" ", resourceClients));
|
|
|
+ if (resourceClients.Length == 1 && resourceClients[0] == ApplicationProfilesPropertyValues.AllowAllApplications)
|
|
|
+ {
|
|
|
+ _logger.LogInformation(LoggerEventIds.AllApplicationsAllowedForApiResource, "Resource '{ApiResourceName}' allows all applications.", resource.Name);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _logger.LogInformation(LoggerEventIds.ApplicationsAllowedForApiResource, "Resource '{ApiResourceName}' allows applications '{resourceClients}'.", resource.Name, string.Join(" ", resourceClients));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
foreach (var client in options.Clients)
|