API OAuth Authorize Callback Error

Hello,

I am trying to implement authentication with OAuth 2.0 and I am getting an error callback when I hit “Deny” button in the authorised page.

I am doing this in Ruby by using Omniauth. By the look of the error message log it appears that it does not route to the auth callback in my rails app. Wonder if anyone can provide some hints or guidance on this?

Started GET “/auth/infusionsoft/callback?state=&error=access_denied&error_uri=https%3A%2F%2Fdeveloper.infusionsoft.com%2Fdocs%2Fread%2FGetting_Started_With_OAuth2&error_description=User+denied+access+to+resource” for 127.0.0.1 at 2019-01-14 19:30:45 +1100
I, [2019-01-14T19:30:45.153154 #86570] INFO – omniauth: (infusionsoft) Callback phase initiated.
E, [2019-01-14T19:30:45.154374 #86570] ERROR – omniauth: (infusionsoft) Authentication failure! access_denied: OmniAuth::Strategies::OAuth2::CallbackError, access_denied | User denied access to resource | xml-rpc - Keap Developer Portal
E, [2019-01-14T19:30:45.154741 #86570] ERROR – omniauth: (infusionsoft) Authentication failure! invalid_credentials: OmniAuth::Strategies::OAuth2::CallbackError, access_denied | User denied access to resource | xml-rpc - Keap Developer Portal

OmniAuth::Strategies::OAuth2::CallbackError (access_denied | User denied access to resource | xml-rpc - Keap Developer Portal):

omniauth (1.3.2) lib/omniauth/failure_endpoint.rb:25:in raise_out!' omniauth (1.3.2) lib/omniauth/failure_endpoint.rb:20:in call’
omniauth (1.3.2) lib/omniauth/failure_endpoint.rb:12:in `call’