From f748bf7ef7cf771cbb591701d28fa692a9b767f8 Mon Sep 17 00:00:00 2001 From: Sambhav Saggi <17993169+9p4@users.noreply.github.com> Date: Fri, 25 Feb 2022 19:51:54 -0500 Subject: [PATCH] Add expected roles for debug --- SSO-Auth/Api/SSOController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SSO-Auth/Api/SSOController.cs b/SSO-Auth/Api/SSOController.cs index 5278f80..301d2e1 100644 --- a/SSO-Auth/Api/SSOController.cs +++ b/SSO-Auth/Api/SSOController.cs @@ -194,7 +194,7 @@ public class SSOController : ControllerBase } else { - _logger.LogWarning("OpenID user " + StateManager[Request.Query["state"]].Username + " has incorrect claims: " + string.Join(", ", result.User.Claims.Select(o => new { o.Type, o.Value }))); + _logger.LogWarning("OpenID user " + StateManager[Request.Query["state"]].Username + " has one or more incorrect role claims: " + string.Join(", ", result.User.Claims.Select(o => new { o.Type, o.Value })) + ". Expected any one of: " + string.Join(", ", config.Roles) + "."); var errorResult = new ContentResult(); errorResult.Content = "Error. Check permissions."; errorResult.ContentType = "text/plain"; @@ -364,7 +364,7 @@ public class SSOController : ControllerBase } } - _logger.LogWarning("SAML user " + samlResponse.GetNameID() + " has insufficient roles: " + string.Join(", ", samlResponse.GetCustomAttributes("Role"))); + _logger.LogWarning("SAML user " + samlResponse.GetNameID() + " has insufficient roles: " + string.Join(", ", samlResponse.GetCustomAttributes("Role")) + ". Expected any one of: " + string.Join(", ", config.Roles) + "."); var errorResult = new ContentResult(); errorResult.Content = "Error. Check permissions."; errorResult.ContentType = "text/plain";