From b6cd5e404eb61b524d3c81324709d8fafad28f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szak=C3=A1ts=20Alp=C3=A1r=20Zsolt?= Date: Sat, 16 Aug 2025 22:36:35 +0200 Subject: [PATCH] Disables issuer validation Disables issuer validation during token authentication. The token validation parameters are adjusted to bypass issuer validation, since the issuer is already validated via the `ValidIssuers` parameter. --- Source/ProofOfConcept/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/ProofOfConcept/Program.cs b/Source/ProofOfConcept/Program.cs index 1823b8b..18bf0c0 100644 --- a/Source/ProofOfConcept/Program.cs +++ b/Source/ProofOfConcept/Program.cs @@ -56,6 +56,7 @@ builder.Services.AddAuthentication(o => // This must match exactly what you register at Tesla o.CallbackPath = new PathString("/token-exchange"); + o.TokenValidationParameters.ValidateIssuer = false; o.TokenValidationParameters.ValidIssuers = ["https://fleet-auth.tesla.com/oauth2/v3/nts", "https://auth.tesla.com/oauth2/v3", "https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3/nts"]; // Scopes you actually need