From 1c35ee7c2bb2934dda0a4f23a34f0ee3e64d5a7c Mon Sep 17 00:00:00 2001 From: Mathieu Gamache Date: Thu, 20 Jun 2024 12:48:23 -0400 Subject: [PATCH] Update src/Workleap.AspNetCore.Authentication.ClientCredentialsGrant/RequireClientCredentialsAttribute.cs Co-authored-by: Anthony Simmon --- .../RequireClientCredentialsAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Workleap.AspNetCore.Authentication.ClientCredentialsGrant/RequireClientCredentialsAttribute.cs b/src/Workleap.AspNetCore.Authentication.ClientCredentialsGrant/RequireClientCredentialsAttribute.cs index 09ee86f..f66702a 100644 --- a/src/Workleap.AspNetCore.Authentication.ClientCredentialsGrant/RequireClientCredentialsAttribute.cs +++ b/src/Workleap.AspNetCore.Authentication.ClientCredentialsGrant/RequireClientCredentialsAttribute.cs @@ -32,7 +32,7 @@ public sealed class RequireClientCredentialsAttribute : AuthorizeAttribute /// [SuppressMessage("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments", Justification = "The arguments are transformed.")] public RequireClientCredentialsAttribute(ClientCredentialsScope scope) - : this(EnumScopeNameMapping.GetValueOrDefault(scope) ?? throw new ArgumentException($"{scope} is not an valid scope value")) + : this(EnumScopeNameMapping.GetValueOrDefault(scope) ?? throw new ArgumentOutOfRangeException(nameof(scope), scope, $"'{scope}' is not an valid scope value")) { }