Updates application registration endpoints
All checks were successful
Build, Push and Run Container / build (push) Successful in 25s
All checks were successful
Build, Push and Run Container / build (push) Successful in 25s
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user