Error Auth2 flow

Information on your n8n setup

  • **n8n version:**1.110.1
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: docker

I try to authenticate via auth2 my remote applciation return the url with code like

rest/oauth2-credential/callback?code=c%2FeyJ0eXAiOiJKV1Q….&state=<>

after code start with c%2 → c/

Anyone has issue with this coding url?

Hey, let’s check these things out:

Make sure your OAuth2 callback URL in n8n is correctly configured: https://your-n8n-domain.com/rest/oauth2-credential/callback

In your app:

  • Redirect URI must exactly match n8n’s callback URL
  • Response Type should be code
  • Grant Type should be authorization_code

Let me know if these are OK

I try but I see the first step where Auth remote ask me to give access but the callback receive response not work

https://secure.fattureincloud.it/oauthauthorize?
// client_id=s<REMOVED>d
// &redirect_uri=https%3A%2F%2F<REMOVED>%2Frest%2Foauth2-credential%2Fcallback
// &response_type=code&scope=entity.clients%3Ar%20entity.clients%3Aa%20entity.suppliers%3Ar// &state=<REMOVED_STATE>
// &checksum=ea0f20c9052e05c2c384a3f3917a7754

https://<REMOVED>/rest/oauth2-credential/callback?code=c%2FeyJ0eXAiOi<REMOVE_PART_OF_TOKEN>XCdiT8HkrifaybJsrrdtpWROQ
// &state=<REMOVED_STATE>

Hey, I figured it out - further down the credentials page, you need to set Authentication = Body, because Fatture requires you to send the credentials in the body of the request. By default Authentication is set to Header, so n8n sends them in the URL instead.

Try that and let me know if it works. Feel free to mark this as solved if it does. :slight_smile:

2 Likes

Great!

Thanks so much!!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.