"unknown_method" displayed when logging in with this plugin
Closed this issue · 1 comments
Hiya, thanks for writing this plugin, it's perfect for what I'm looking to do.
In my case, I'm using Slack to sign in. I've set up the client id/secret, endpoints, JSON paths and scopes. When hitting the "OAuth sign in " link, I'm taken to my Slack workspace, I approve access to my identity and my email, then it redirects me back to my Wiki.
I then get a page which just says 'unknown_method'. The URL I'm on when I get the error looks like this:
http://[IP OF MY WIKI]/wiki/Special:OAuth2Client/callback?code=[BIG CODE VALUE]&state=[STATE VALUE]
which looks like everything has gone well up to that point.
Does anyone have any pointers?
Thanks
Barny
Managed to solve this one myself in the end. I was using slightly incorrect endpoint URLs for the Slack API. In case anyone else hits this, here's the values I ended up with for using Slack:
$wgOAuth2Client['configuration']['authorize_endpoint'] = 'https://slack.com/oauth/authorize';
$wgOAuth2Client['configuration']['access_token_endpoint'] = 'https://slack.com/api/oauth.access';
$wgOAuth2Client['configuration']['api_endpoint'] = 'https://slack.com/api/users.identity';
$wgOAuth2Client['configuration']['username'] = 'user.name'; // JSON path to username
$wgOAuth2Client['configuration']['email'] = 'user.email'; // JSON path to email
$wgOAuth2Client['configuration']['scopes'] = 'identity.email identity.basic'; //Permissions