XF 2.3 API / Oauth2 : get username and email [2.3.0B5]

ndahiya

Member
hi -

am trying to get OAuth2 to work with xenforo as the master and mediawiki as the client. fwiw, i am using "oauth2 client" extension for mediawiki.

the relevant settings are:
$wgOAuth2Client['client']['id'] = 'xxxxx'; // The client ID assigned to you by the provider
$wgOAuth2Client['client']['secret'] = 'xxxxx'; // The client secret assigned to you by the provider

$wgOAuth2Client['configuration']['authorize_endpoint'] = 'https://mysite/f/index.php?oauth2/authorize'; // Authorization URL
$wgOAuth2Client['configuration']['access_token_endpoint'] = 'https://mysite/f/index.php?api/oauth2/token'; // Token URL
$wgOAuth2Client['configuration']['api_endpoint'] = 'https://mysite/f/index.php?api/me'; // URL to fetch user JSON
$wgOAuth2Client['configuration']['redirect_uri'] = 'https://mysite/wiki/index.php?title=Special:OAuth2Client/callback'; //$

$wgOAuth2Client['configuration']['username'] = 'username'; // JSON path to username
$wgOAuth2Client['configuration']['email'] = 'email'; // JSON path to email

$wgOAuth2Client['configuration']['scopes'] = 'user:read'; //Permissions

i am able to see the login page when i click on Oauth2 login in mediawiki, but the username and email are not getting passed to mediawiki on the redirect back.
any help appreciated!
 
Last edited:
I'm not familiar with the MediaWiki plugin but you can view the api/me/ response format here:

It returns one field me with the user API result, so the JSON paths are presumably me.username and me.email.
 
Last edited:
Top Bottom