Oauth config for memberful (not working)

(Jay Pfaffman) #1

A client wants some people to use Memberful, so the default SSO solution won’t work. They also support oauth. To my naive eye, it looks standard enough, so I installed the oauth basic support plugin and set out to configure stuff.

It gets far enough to generate the user_json_url correctly; if I open up the URL printed in the logs in a web browser, I get what I’m looking for. But it generates a 500 error and the “Oops” message in the browser.

I can’t tell if it’s something on my side or the Memberful side. I’m pretty clear that this will need a plugin to pull group/order information, but thought that just getting authorizations to would might work with the stock plugin.

I configured the redirect url on the memberful side to be Redirect URLhttps://support.literatecomputing.com/auth/oauth2_basic/callback

Here are the logs:

[default] (oauth2_basic) Setup endpoint detected, running now.
[default] (oauth2_basic) Callback phase initiated.
[default] Processing by Users::OmniauthCallbacksController#complete as HTML
[default]   Parameters: {"code"=>"CODE", "state"=>"STATE", "provider"=>"oauth2_basic"}
[default] OAuth2 Debugging: after_authenticate response: 

creds: {"token"=>"A_TOKEN", "refresh_token"=>"RTOKEN", "expires_at"=>1525127745, "expires"=>true}
info: {"id"=>nil, "name"=>nil}
extra: {}
[default] OAuth2 Debugging: user_json_url: GET https://lc.memberful.com/account.json?access_token=A_TOKEN
[default] Completed 500 Internal Server Error in 237ms (ActiveRecord: 2.8ms)
[default] OpenURI::HTTPError (500 Internal Server Error)
/usr/local/lib/ruby/2.4.0/open-uri.rb:363:in `open_http'



I can’t quite figure out just what’s wrong with

The JSON returned by Memberful looks like this:

member: {
address: { },
created_at: 1524522604,
credit_card: {
exp_month: 11,
exp_year: 2022
custom_field: "",
email: "jay@example.com",
first_name: "Jay",
full_name: "Jay Pfaffman",
id: 542677,
last_name: "Pfaffman",
phone_number: null,
tracking_params: { },
unrestricted_access: false,
username: "jay1192885"

I’ve configured oauth2 json stuff like this:

oauth2 json user id path: member.id
oauth2 json username path: member.username
oauth2 json name path: member.full_name
oauth2 json email path: member.email