> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://teslemetry.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Tesla Authentication and Reauthentication

This guide covers how authentication works between Teslemetry and Tesla, common authentication issues, and step-by-step instructions for resolving them.

## How Authentication Works

Teslemetry uses Tesla's OAuth 2.0 authentication system. When you log in at [teslemetry.com/login](https://teslemetry.com/login), you are redirected to **auth.tesla.com** where you enter your Tesla username, password, and two-factor authentication (if enabled). Teslemetry never sees or stores your Tesla password.

Key points about the authentication system:

* **OAuth 2.0**: Teslemetry receives tokens from Tesla that grant access to your account based on the scopes (permissions) you approve
* **Automatic Token Refresh**: Access tokens are refreshed automatically shortly before they expire (and on demand if Tesla reports one invalid) - refresh is expiry-driven, not on a fixed schedule
* **Token Revocation**: Tokens are automatically deleted if they have been revoked by Tesla

---

## Frequently Asked Questions

### Why did I receive an authentication failure email from Teslemetry?

This notification is sent when Teslemetry can no longer successfully authenticate with Tesla on your behalf. The most common causes are:

1. **Password Change**: You changed your Tesla account password
2. **Access Revoked**: You revoked Teslemetry's access at [auth.tesla.com](https://auth.tesla.com)
3. **Tesla Backend Issues**: Tesla occasionally has authentication problems that affect all third-party apps
4. **Token Expiration**: Your refresh token may have expired or become invalid

The email will instruct you to visit [teslemetry.com/login](https://teslemetry.com/login) to reauthenticate.

### How do I fix authentication issues?

Follow these steps to resolve most authentication issues:

1. **Visit the Login Page** - Go to [teslemetry.com/login](https://teslemetry.com/login)
2. **Complete Tesla Authentication** - You will be redirected to auth.tesla.com
3. **Select Scopes** - If prompted, select the permissions you want to grant Teslemetry (recommend enabling all for full functionality)
4. **Wait for Console to Load** - This confirms your new tokens are active
5. **Restart Home Assistant (if applicable)** - Restart Home Assistant or reload the Teslemetry integration

### Why do I keep getting 401 authentication failures?

401 errors can occur for several reasons:

**User-side causes:**
* Your Tesla password was changed
* Your Tesla access token has been revoked
* You denied required scopes during authentication

**Resolution:**
1. Visit [teslemetry.com/login](https://teslemetry.com/login) and reauthenticate
2. Restart or reload your Home Assistant integration
3. If the problem persists, check [Teslemetry Status](https://status.teslemetry.com) for any ongoing issues

### My Tesla password changed and now Teslemetry doesn't work

When you change your Tesla password, all existing OAuth tokens are invalidated by Tesla. This is a security feature.

**To restore access:**
1. Go to [teslemetry.com/login](https://teslemetry.com/login)
2. Log in with your new Tesla password
3. Approve the scopes if prompted
4. Restart Home Assistant or reload the Teslemetry integration

---

## Common Causes of Authentication Failures

| Cause | Description | Resolution |
| ---- |
| Password Change | Tesla invalidates all tokens when you change your password | Reauthenticate at [teslemetry.com/login](https://teslemetry.com/login) |
| Access Revoked | You revoked access at auth.tesla.com | Reauthenticate to restore access |
| Scope Denial | Required scopes were not approved | Log in again and approve the necessary scopes |
| Tesla Backend Issues | Tesla's authentication servers are experiencing problems | Wait and try again |
| Token Expiration | Tokens failed to refresh | Reauthenticate at [teslemetry.com/login](https://teslemetry.com/login) |

---

## Related Documentation

* [Initial Setup](https://teslemetry.com/docs/getting-started/initial-setup)
* [Security](https://teslemetry.com/docs/about/security)
* [Teslemetry Status](https://status.teslemetry.com)