From f06dd7221385e796f60a7e2fbd292ee724c48574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szak=C3=A1ts=20Alp=C3=A1r=20Zsolt?= Date: Mon, 18 Aug 2025 12:28:05 +0200 Subject: [PATCH] Updates application registration endpoints Changes the application registration endpoints to use the ITeslaAuthenticatorService interface. Updates the KeyPairing endpoint to redirect to the correct Tesla connector app. Adds a new KeyPairing2 endpoint. --- Source/ProofOfConcept/Program.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/ProofOfConcept/Program.cs b/Source/ProofOfConcept/Program.cs index 4a672be..20960f7 100644 --- a/Source/ProofOfConcept/Program.cs +++ b/Source/ProofOfConcept/Program.cs @@ -169,10 +169,11 @@ if (app.Environment.IsDevelopment()) return JsonSerializer.Serialize(token, new JsonSerializerOptions() { WriteIndented = true }); }); - app.MapGet("/CheckRegisteredApplication", ([FromServices] TeslaAuthenticatorService service) => service.CheckApplicationRegistrationAsync()); - app.MapGet("/RegisterApplication", ([FromServices] TeslaAuthenticatorService service) => service.RegisterApplicationAsync()); + app.MapGet("/CheckRegisteredApplication", ([FromServices] ITeslaAuthenticatorService service) => service.CheckApplicationRegistrationAsync()); + app.MapGet("/RegisterApplication", ([FromServices] ITeslaAuthenticatorService service) => service.RegisterApplicationAsync()); app.MapGet("/Authorize", async (IHttpContextAccessor contextAccessor) => await (contextAccessor.HttpContext!).ChallengeAsync(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties { RedirectUri = "/Tesla" })); - app.MapGet("/KeyPairing", () => Results.Redirect("https://tesla.com/_ak/developer-domain.com")); + app.MapGet("/KeyPairing", () => Results.Redirect("https://tesla.com/_ak/tesla-connector.automatic-parking.app")); + app.MapGet("/KeyPairing2", () => Results.Redirect("https://tesla.com/_ak/automatic-parking.app")); app.MapGet("/Tokens", async (IHttpContextAccessor httpContextAccessor) => { var ctx = httpContextAccessor.HttpContext;