Fix ValidIssuers in Client Auth
All checks were successful
Gateway / build-deploy (push) Successful in 1m44s
All checks were successful
Gateway / build-deploy (push) Successful in 1m44s
This commit is contained in:
@@ -239,13 +239,13 @@ public sealed class ClientAuthMiddleware
|
|||||||
var data = root.TryGetProperty("data", out var dataProp) ? dataProp : root;
|
var data = root.TryGetProperty("data", out var dataProp) ? dataProp : root;
|
||||||
|
|
||||||
clientContext.SessionId = data.TryGetProperty("sessionId", out var sid) ? sid.GetString() : null;
|
clientContext.SessionId = data.TryGetProperty("sessionId", out var sid) ? sid.GetString() : null;
|
||||||
clientContext.ClientId = data.TryGetProperty("clientId", out var cid) ? cid.GetString() : null;
|
clientContext.ClientId = data.TryGetProperty("clientId", out var cid) ? cid.GetString() : null;
|
||||||
clientContext.ClientName = data.TryGetProperty("clientName", out var cn) ? cn.GetString() : null;
|
clientContext.ClientName = data.TryGetProperty("clientName", out var cn) ? cn.GetString() : null;
|
||||||
clientContext.ClientCategory = data.TryGetProperty("clientCategory", out var ccat) ? ccat.GetString() : null;
|
clientContext.ClientCategory = data.TryGetProperty("clientCategory", out var ccat) ? ccat.GetString() : null;
|
||||||
clientContext.UserId = data.TryGetProperty("userId", out var uid) ? uid.GetString() : null;
|
clientContext.UserId = data.TryGetProperty("userId", out var uid) ? uid.GetString() : null;
|
||||||
clientContext.Email = data.TryGetProperty("userEmail", out var ue) ? ue.GetString() : null;
|
clientContext.Email = data.TryGetProperty("userEmail", out var ue) ? ue.GetString() : null;
|
||||||
clientContext.Role = data.TryGetProperty("role", out var role) ? role.GetString() : null;
|
clientContext.Role = data.TryGetProperty("role", out var role) ? role.GetString() : null;
|
||||||
clientContext.IsDevBypass = false;
|
clientContext.IsDevBypass = false;
|
||||||
|
|
||||||
_logger.LogWarning("[Auth] Session validated OK | ClientId={ClientId} Email={Email} | Corr={Corr}",
|
_logger.LogWarning("[Auth] Session validated OK | ClientId={ClientId} Email={Email} | Corr={Corr}",
|
||||||
clientContext.ClientId, clientContext.Email, corrId);
|
clientContext.ClientId, clientContext.Email, corrId);
|
||||||
@@ -357,7 +357,11 @@ public sealed class ClientAuthMiddleware
|
|||||||
var validationParams = new TokenValidationParameters
|
var validationParams = new TokenValidationParameters
|
||||||
{
|
{
|
||||||
ValidateIssuer = true,
|
ValidateIssuer = true,
|
||||||
ValidIssuers = new[] { $"{instance.TrimEnd('/')}/{tenantId}/v2.0" },
|
ValidIssuers = new[]
|
||||||
|
{
|
||||||
|
$"https://login.microsoftonline.com/{tenantId}/v2.0",
|
||||||
|
$"https://sts.windows.net/{tenantId}/"
|
||||||
|
},
|
||||||
|
|
||||||
ValidateAudience = true,
|
ValidateAudience = true,
|
||||||
ValidAudiences = validAudiences,
|
ValidAudiences = validAudiences,
|
||||||
|
|||||||
Reference in New Issue
Block a user