Code Monkey home page Code Monkey logo

omniauth-myob's People

Contributors

bitdeli-chef avatar davidlumley avatar ghiculescu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

omniauth-myob's Issues

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

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)

`raw_info` is an empty Array

When attempting to use this strategy, the OAuth flow works well until the callback gets hit.

The uid method fails because raw_info as loaded by the api is an empty array.

What causes this - or more importantly, what does it mean?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.