Wikimedia Developer Support

Help required to enable Mediawiki OAuth in VideoCutTool (Node.js)

oauth
nodejs
video-cut-tool

#1

I’m facing a minor issue and after putting much effort to fix this, I thought of asking for help/Advice to make a fix.

I have hosted the back-end of VideoCutTool in toolforge, https://tools.wmflabs.org/video-cut-tool-back-end/ and I’m trying to implement the MediaWiki OAuth by taking https://github.com/srish/nodejs-mediawiki-oauth-tool as a reference.

I have implemented here https://github.com/gopavasanth/video-cut-tool-back-end/blob/master/routes/index.js#L25

But when I use this https://tools.wmflabs.org/video-cut-tool-back-end/login route
I’m facing issue as “OAuth authentication requires session support”, When I tried to implement this in my local server https://ibb.co/qD0BvmK :frowning:

I tried to fix this my self, I searched around and also went through the https://stackoverflow.com/questions/22298033/nodejs-passport-error-oauthstrategy-requires-session-support but nothing worked out :frowning:


#2

@Gopavasanth I’m looking into your code. For working in localhost, maybe stick to the changes that were there in the repo before this commit which means not using express.router and making get request on express variable app. Also, ensure that express-session is installed, your redirect URL is complete and has /video-cut-tool-back-end, and then callback URL in OAuth consumer setting looks like: http://localhost:4000/video-cut-tool-back-end/auth/mediawiki/callback. By ensuring these changes are in place, I was able to resolve the OAuth authentication requires session support error and got to the Application connection error page on Meta. As an app owner, you might be able to take care of this error.