XF 2.3 XenForo OAuth troubleshooting help needed MediaWiki

Bryan_D2

New member
I'm new to XenForo; our whole forum is moving to XenForo from vBulletin in the next few weeks. We have run into a problem with OAuth talking to MediaWiki. So, after a lot of debugging and troubleshooting, I tried a different solution, using WordPress as an OAuth client and XenForo as the OAuth provider. I end up with the same problem. Data is not being sent back to MediaWiki or WordPress. I also tested via curl and Postman; all results were the same.

I'm trying to find a few things.
1) Any logs related to OAuth on XenForo
2) Is there a further configuration outside of the OAuth that I need to enable on the XenForo side?
3) Is there a better way to troubleshoot XenForo Oauth as a provider?


Error message example
Invalid response received from Auth Provider. Contact your administrator for more details.
Response :
{ "message": "Sorry, we're currently unavailable. Please check back later." }

WordPress:
Error
Token Response Received = {

MediaWiki
For MediaWiki I am using the Extensions PluggableAuth and WSOAuth. For WSOAuth I had to build a custom XenForo provider. If I can get this all working, I hope to share it with the world.
Error
The username provided by the OAuth provider is not valid.
Further logging resulting in this
*Token URI during construction: NULL
*Failed to decode token response: Syntax error
*Raw Token Response: false

Thanks in advance for any help or ideas you can share.
 
Is that all you got in the log for the OAuth login attempt?
With a fresh browser / cleared cookie / incognito tab?

There should be a lot more as shown in https://xenforo.com/community/threa...ing-help-needed-mediawiki.230291/post-1743141
Yup, I've flushed cache, tried in private mode. Also been testing in FireFox, Brave,Chrome and Safari too.

I also flushed caches in MediaWiki too. ( php maintenance/update.php in the MediaWiki root folder. )

I don't see everthing in your post. I see the calls in the code to write to the log but don't see them. I see the below with special edits and redactions. Again thank you for looking.

Code:
wsoauth-xenforo-log
2025-04-28 00:26:55 dev wiki_new-mw_: XenForoOAuthProvider Initialized.
2025-04-28 00:26:55 dev wiki_new-mw_: Auth URI: https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize
2025-04-28 00:26:55 dev wiki_new-mw_: Token URI: https://teststar2.astromech.net/xenforo/index.php?api/oauth2/token
2025-04-28 00:26:55 dev wiki_new-mw_: User Info URI: https://teststar2.astromech.net/xenforo/api/me
2025-04-28 00:26:55 dev wiki_new-mw_: Redirect URI: https://teststar2.astromech.net/wiki/index.php/Special:PluggableAuthLogin
2025-04-28 00:26:55 dev wiki_new-mw_: Auth URI (constructor): https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize
2025-04-28 00:26:55 dev wiki_new-mw_: Token URI (constructor): https://teststar2.astromech.net/xenforo/index.php?api/oauth2/token
2025-04-28 00:26:55 dev wiki_new-mw_: In WSOAuth\WSOAuth::initiateLogin
2025-04-28 00:26:55 dev wiki_new-mw_: login called. Generating authorization URL.
2025-04-28 00:26:55 dev wiki_new-mw_: Authorization URL generated: https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize?response_type=code&client_id=~~redactedcode~~&redirect_ur>
2025-04-28 00:26:55 dev wiki_new-mw_: login output: Key=, Secret=~~redacted~~
2025-04-28 00:26:55 dev wiki_new-mw_: Authorization code dynamically set:
///At this point the browser flips me back to Xenforo.
///Return to Mediawiki page click on Login with XenForo button again
2025-04-28 00:26:58 dev wiki_new-mw_: XenForoOAuthProvider Initialized.
2025-04-28 00:26:58 dev wiki_new-mw_: Auth URI: https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize
2025-04-28 00:26:58 dev wiki_new-mw_: Token URI: https://teststar2.astromech.net/xenforo/index.php?api/oauth2/token
2025-04-28 00:26:58 dev wiki_new-mw_: User Info URI: https://teststar2astromech.net/xenforo/api/me
2025-04-28 00:26:58 dev wiki_new-mw_: Redirect URI: https://teststar2.astromech.net/wiki/index.php/Special:PluggableAuthLogin
2025-04-28 00:26:58 dev wiki_new-mw_: Auth URI (constructor): https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize
2025-04-28 00:26:58 dev wiki_new-mw_: Token URI (constructor): https://teststar2.astromech.net/xenforo/index.php?api/oauth2/token
2025-04-28 00:26:58 dev wiki_new-mw_: In WSOAuth\WSOAuth::continueLogin
2025-04-28 00:26:58 dev wiki_new-mw_: Request failed or user is not authorised
 
I don't see everthing in your post. I see the calls in the code to write to the log but don't see them. I see the below with special edits and redactions. Again thank you for looking.
I've added a bit more logging, maybe this does help.


///At this point the browser flips me back to Xenforo.
///Return to Mediawiki page click on Login with XenForo button again
Hmm ... that's not how it should work:

View attachment Login-required---Testwiki.webm
 

Attachments

Thank you again. No I am not seeing that, but seeing you having that is giving me hope. I can share a video if you want.
I see one thing of note and new in the logs "Error: Could not get code from Array"

Code:
2025-04-29 02:22:57 dev wiki_new-mw_: XenForoOAuthProvider Initialized.
2025-04-29 02:22:57 dev wiki_new-mw_: Auth URI: https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize
2025-04-29 02:22:57 dev wiki_new-mw_: Token URI: https://teststar2.astromech.net/xenforo/index.php?api/oauth2/token
2025-04-29 02:22:57 dev wiki_new-mw_: User Info URI: https://teststar2.astromech.net/xenforo/api/me
2025-04-29 02:22:57 dev wiki_new-mw_: Redirect URI: https://teststar2.astromech.net/wiki/index.php/Special:PluggableAuthLogin
2025-04-29 02:22:57 dev wiki_new-mw_: Auth URI (constructor): https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize
2025-04-29 02:22:57 dev wiki_new-mw_: Token URI (constructor): https://teststar2.astromech.net/xenforo/index.php?api/oauth2/token
2025-04-29 02:22:57 dev wiki_new-mw_: In WSOAuth\WSOAuth::initiateLogin
2025-04-29 02:22:57 dev wiki_new-mw_: login called. Generating authorization URL.
2025-04-29 02:22:57 dev wiki_new-mw_: Authorization URL generated: https://dev.astromech.net/xenforo/index.php?oauth2/autho>
2025-04-29 02:22:57 dev wiki_new-mw_: login output: Key=, Secret=~~~removed~~~
2025-04-29 02:22:57 dev wiki_new-mw_: Authorization code dynamically set:
2025-04-29 02:23:04 dev wiki_new-mw_: XenForoOAuthProvider Initialized.
2025-04-29 02:23:04 dev wiki_new-mw_: Auth URI: https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize
2025-04-29 02:23:04 dev wiki_new-mw_: Token URI: https://teststar2.astromech.net/xenforo/index.php?api/oauth2/token
2025-04-29 02:23:04 dev wiki_new-mw_: User Info URI: https://teststar2.astromech.net/xenforo/api/me
2025-04-29 02:23:04 dev wiki_new-mw_: Redirect URI: https://teststar2.astromech.net/wiki/index.php/Special:PluggableAuthLogin
2025-04-29 02:23:04 dev wiki_new-mw_: Auth URI (constructor): https://teststar2.astromech.net/xenforo/index.php?oauth2/authorize
2025-04-29 02:23:04 dev wiki_new-mw_: Token URI (constructor): https://teststar2.astromech.net/xenforo/index.php?api/oauth2/token
2025-04-29 02:23:04 dev wiki_new-mw_: In WSOAuth\WSOAuth::continueLogin
2025-04-29 02:23:04 dev wiki_new-mw_: Error: Could not get code from Array
2025-04-29 02:23:04 dev wiki_new-mw_: Request failed or user is not authorised
 
Back
Top Bottom