jeffw16 / JWTAuth

Adds support for using JSON Web Tokens to log in to MediaWiki.
MIT License
3 stars 5 forks source link

Adapt JWTAuth to use PluggableAuth #4

Closed cicalese closed 1 year ago

olsonjaredm commented 1 year ago

Successful test of auto-login on Space-Wiki using PA 7.0 and your JWTAuth fork! once users get through the upstream SSO login they are sent to Special:UserLogin, logged in via JWT, and redirected to the main page.

I had to add 'Algorithm' => 'RS256' to the local settings config, otherwise I got malformed JWT

$wgPluggableAuth_Config = [
  "Platform One" => [
    'plugin' => 'JWTAuth',
    'data' => [
      'Key' => '-----BEGIN PUBLIC KEY-----
..................
-----END PUBLIC KEY-----',
      'Algorithm' => 'RS256'
    ]
  ]
];
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['autocreateaccount'] = true;
$wgPluggableAuth_EnableAutoLogin    = true;
$wgPluggableAuth_EnableLocalProperties  = false;
jeffw16 commented 1 year ago

A million thanks to @cicalese for making this possible. I'll merge this and call this JWTAuth 2.0 :)