OAuth 2.0 allows a user to authorize your app to work with specific tools in their HubSpot account, designated by the authorization scopes you set.
Note: if you want a Django version, I have contributed a hubspot integration for django-allauth
- Caddy (Because of recent license change)
- Docker (Portability)
- Flask (Light resource usage)
- Github Actions (CI)
- Mkcert (Dead simple local SSL certs)
- PyTest (Testing)
Note: This app by default only passes oauth
scope when logging in users. You will need to add the appropriate scope to take advantage of other tools that a user might have. More about that here
git clone https://github.com/vladdoster/hubspot_oauth2_with_flask.git
cd hubspot_oauth2_with_flask/
3. Generate SSL certificates to appease HubSpot HTTPS requirement for oauth callback. A script has been written to aid this effort.
sh ./scripts/generate_certs
If the scrip does not work, here's how you can do it manually for Windows:
- Install Chocolatey (will be needed for installing mkcert) Link to Installation
- Install mkcert
choco install mkcert
- Redicrect to "/certs" and run
mkcert -install hs-oauth.localhost
Note: Linux users install OpenSSL via system package manager and Windows users need to install OpenSSL via a .exe
If successful, you should have a key.pem and cert.pem file in the certs/ directory
docker-compose up --build
6. Direct a browser towards https://hs-oauth.localhost!
Please open an issue or contact me directly: mvdoster@gmail.com
If this in anyway helpful, leave a 🌟 so others see it!
Hiring? Need a developer? I love solving problems.