Permissions dialog redirects to /auth/failure?message=invalid_credentials

Hello,

We have an issue with an application (ID: 1371066) that used to work but fails to let any new users to connect, or let existing ones to re-connect.

The current behaviour is as follows. When OAuth authorization is initiated by following the https://app-eu1.hubspot.com/oauth/authorize?client_id=6bc7fd7f-5175-425c-848c-158c4365074e&redirect_uri=https://app.ablecdp.com/auth/hubspot/callback&scope=crm.schemas.deals.read%20crm.objects.deals.read%20crm.schemas.contacts.read%20crm.objects.contacts.read link and selecting an account, the following screen is displayed for a split-second:

However, as soon as the wait icon on the submit button disappears and it becomes blank as shown on the screenshot above, it immediately redirects to the following path on the app domain: /auth/failure?message=invalid_credentials&origin=<app url>&strategy=hubspot

(Not to the callback URL.)

This happens within <100ms, not allowing user to make any input. Obvious workarounds such as using private browsing mode without any cached cookies didn’t help.

This has been reproduced with our customer who reported this issue originally, as well as with the developer’s test account.

What would be the reasons why this is happening and how to make the app work again?

I’m especially confused as the way the redirect is made and the failure parameters appear to differ from the examples in documentation (Working with OAuth - HubSpot docs) and there are no details beyond the ‘invalid_credentials’ in the URL.

Hey @PTitov :waving_hand: Thanks for your question. As an additional troubleshooting step, have you tried collecting and analyzing a HAR file? Occasionally, the full missing scopes error can be revealed this way.

Basic steps:

This doesn’t always reveal the issue, but it’s a good next step to try if you haven’t already done so.

Best,

Jaycee

Thank you Jaycee, this really helped!

The root issue turned out to be an unrelated dependency update that triggered Enforce that HubSpot wants credentials in request body by swanson · Pull Request #2 · romanos/omniauth-hubspot · GitHub

Amazing! Thank you very much for taking the time to come back and let us know what worked! — Jaycee