Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR -- omniauth: (myob) Authentication failure! invalid_credentials: OAuth2::Error, invalid_request: #5

Open
cameronbourgeois opened this issue Dec 6, 2021 · 0 comments

Comments

@cameronbourgeois
Copy link

cameronbourgeois commented Dec 6, 2021

Reproduction steps:

  1. Initialise oaith by visiting the /auth/myob URL
  2. Select "Allow access" on the "Allow access to your MYOB Account?" screen.

Expected result:

It should redirect to my successful callback endpoint where I can get an access code for API access.

Actual Result:

It redirects to a failure callback. The following errors are in the logs:

application_1 | D, [2021-12-06T03:16:20.665570 #1] DEBUG -- omniauth: (myob) Callback phase initiated.
application_1 | E, [2021-12-06T03:16:21.135606 #1] ERROR -- omniauth: (myob) Authentication failure! invalid_credentials: OAuth2::Error, invalid_request:
application_1 | {"error":"invalid_request"}

I am fairly confident that "invalid_credentials" is a red herring here.

It all works fine and I get an access code if I follow the manual example in the myob-api gem. I have other oauth integrations however, so I would prefer not to manually craft this.

My config is fairly straightforward:

Rails.application.config.middleware.use OmniAuth::Builder do
    :myob,
    ENV['MYOB_API_CONSUMER_KEY'],
    ENV['MYOB_API_CONSUMER_SECRET'],
    redirect_uri: ENV['MYOB_API_AUTH_CALLBACK_URI']
  )
end

The relevant gems I am using are:

    oauth2 (1.4.7)
      faraday (>= 0.8, < 2.0)
      jwt (>= 1.0, < 3.0)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (>= 1.2, < 3)
    omniauth (2.0.4)
      hashie (>= 3.4.6)
      rack (>= 1.6.2, < 3)
      rack-protection
    omniauth-myob (0.0.2)
      omniauth-oauth2 (~> 1.1)
    omniauth-oauth2 (1.7.2)
      oauth2 (~> 1.4)
      omniauth (>= 1.9, < 3)
    omniauth-xero-oauth2 (1.0.2)
      omniauth (~> 2.0.0)
      omniauth-oauth2 (~> 1.7.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant