APIs & Integrations

strogonoff
Member

Bare “Access Denied” page when initiating OAuth2 flow

While developing an integration for a client, I’m creating this URL to start the OAuth2 flow:

https://app.hubspot.com/oauth/authorize?scope=contacts&client_id=e5adbac4-2c32-4791-ba4f-8b6b2f6ae16...

(client_id above is my own used for development purposes.)

When accessing that URL I see a screen without Hubspot branding that reports the following:

Access Denied
You don’t have permission to access "http://app.hubspot.com/oauth/authorize?" on this server.
Reference #18.e3db0d17.1493540454.ba4452e

Set up HTTPS on my development server. Tried redirect_uri values in both quoted and unqouted forms. Not sure where else to dig.

Please let me know how to troubleshoot this!

Cheers,
Anton

0 Upvotes
2 Replies 2
Dadams
HubSpot Employee
HubSpot Employee

Bare “Access Denied” page when initiating OAuth2 flow

Hi @strogonoff

The issue is the IP address being used as the redirect URL. Our application firewall doesn’t allow IPs to be used that way, so you’ll need to use a domain name for the redirect.

0 Upvotes
strogonoff
Member

Bare “Access Denied” page when initiating OAuth2 flow

Thanks @dadams. The integration did work after a deployment to EC2.

For local development I had my app run under a .local domain initially but OAuth for another service in the integration turned out to specifically not work with those. They are fine with bare IP though so I got rid of .local before I started with Hubspot’s OAuth. I’ll see if I find some way to make both services authenticate me locally, so far it seems it’s either one or the other :man_facepalming:

0 Upvotes