Beispiel #1
0
        private TeslaAuthentication FakeAuth()
        {
            var developer = LocalFileParser.GetDeveloper();

            return(new TeslaAuthentication(
                       accessToken: developer.AccessToken,
                       tokenType: developer.TokenType,
                       expiresIn: developer.ExpiresIn,
                       createdAt: developer.CreatedAt,
                       refreshToken: developer.RefreshToken
                       ));
        }
        public async Task <TeslaAuthentication> Login(string email, string password)
        {
            var clientKeys = LocalFileParser.GetTeslaClient();
            var client     = new TeslaAuthClient(httpClient);
            var login      = await client.RequestAccessTokenAsync(
                clientId : clientKeys.ClientId,
                clientSecret : clientKeys.ClientSecret,
                email : email,
                password : password);

            return(new TeslaAuthentication(login.Data));
        }