![Buy Me a Coffee](https://github.com/brandon-grant/brandon-grant/raw/243524fee028be9f7adbc8c49534e07e7c17c1d7/bmc-button.png)
This repository contains the implementation for handling the OAuth flow to retrieve an access token from Ford's API. The project leverages various technologies to authenticate users and manage interactions with Ford's API securely and efficiently.
- Node.js (v14 or later)
- npm or yarn
- Firebase CLI
-
Clone the repository:
git clone https://github.com/brandon-grant/ford-connected-car.git cd ford-connected-car
-
Install dependencies:
npm install # or yarn install
-
Deploy to Firebase:
firebase deploy --only functions
-
Run the application locally:
firebase emulators:start
Here's a basic example of how to use the OAuth2 client to get an access token:
import { OAuth2Client } from './lib/auth/oauth-client';
const authClient = new OAuth2Client({ username: '[email protected]', password: 'your-password' });
authClient.getAccessTokenFromAuthCode()
.then(token => {
console.log('Access Token:', token);
})
.catch(error => {
console.error('Error:', error);
});
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes or improvements.
This code is not affiliated with, endorsed by, or connected to Ford Motor Company. It is an independent project intended for educational and research purposes only.