Bare “Access Denied” page when initiating OAuth2 flow

oauth

#1

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-8b6b2f6ae166&redirect_uri=https://127.0.0.1:8000/hubspot_oauth/

(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


#2

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.


#3

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: