Correct JSON
All checks were successful
Build, Push and Run Container / build (push) Successful in 24s
All checks were successful
Build, Push and Run Container / build (push) Successful in 24s
This commit is contained in:
@@ -18,12 +18,20 @@ public class TeslaAuthenticatorService
|
||||
const string authEndpointURL = "https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3/token";
|
||||
const string euBaseURL = "https://fleet-api.prd.eu.vn.cloud.tesla.com";
|
||||
|
||||
private JsonSerializerOptions serializerOptions;
|
||||
|
||||
public TeslaAuthenticatorService(ILogger<TeslaAuthenticatorService> logger, IOptions<TeslaAuthenticatorServiceConfiguration> options, IHttpClientFactory httpClientFactory, IMemoryCache memoryCache)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.httpClientFactory = httpClientFactory;
|
||||
this.memoryCache = memoryCache;
|
||||
this.configuration = options.Value;
|
||||
|
||||
serializerOptions = new JsonSerializerOptions()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower
|
||||
};
|
||||
}
|
||||
|
||||
/// Asynchronously retrieves an authentication token from the Tesla partner API.
|
||||
@@ -39,7 +47,7 @@ public class TeslaAuthenticatorService
|
||||
|
||||
// URL to request the token
|
||||
const string audience = euBaseURL;
|
||||
|
||||
|
||||
// Prepare the form-urlencoded body
|
||||
Dictionary<string, string> formData = new Dictionary<string, string>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user