requarks / wiki

Wiki.js | A modern and powerful wiki app built on Node.js
https://js.wiki
GNU Affero General Public License v3.0
24.67k stars 2.73k forks source link

Twitch Login Strategy Error :: Parameter redirect_uri does not match registered URI #1268

Open b3ck opened 4 years ago

b3ck commented 4 years ago

Actual behavior

After adding in all of the correct information (from Twitch Dev Console) in the Twitch Strategy Module I tried to login and get the following error: Parameter redirect_uri does not match registered URI

Wiki.js Twitch Strategy Error


Expected behavior

Log into Wiki.js with Twitch Username.


Steps to reproduce the behavior

Try to log in?


System Information:

Wiki.js: Stable 2.0.12 OS: Ubuntu 16.04 x86_64 DB: PostgreSQL 9.5 SSL Enabled: Let's Encrypt

NGPixel commented 4 years ago

Make sure the redirect URI you entered in Twitch matches the one shown in Wiki.js in Admin > Authentication > Twitch in the reference panel.

b3ck commented 4 years ago

It does match, I was looking at the code, for the Twitch strategy and it doesn't seem it's using the authorization URL or the scope like in the Discord strategy.. but then again.. I'm not a coder =/

Twitch Discord Strategies

Edit: I was able to get the Discord login to work, Twitch did update their API, so I don't know how recently you've made sure it works or not.

b3ck commented 4 years ago

So I went into the passport-twitch strategy, and replaced the old authorization URLs with the new twitch api, now I need to figure out a way to fetch the user profile as that is my current error:

Twitch Fetch Error

Obviously this is going to happen since I totally switched to a different API, so more investigating is in order, I'll update you when I can.

b3ck commented 4 years ago

Yeah.. I don't know what Twitch API you guys have this based on, there is v3, v5 and now the "New Twitch API" so.. I don't know.. getting kinda lost in all of these APIs so I'm going to stop for now, let me know if you come up with anything, thanks 😄👍

b3ck commented 4 years ago

So I changed everything back to default and replaced line 16 in the /server/modules/authentication/twitch/authentication.js file;

from: callbackURL: conf.callbackURL to: callbackURL: "https://wiki.b3ck.com/login/twitch/callback"

And I am no longer getting the: Parameter redirect_uri does not match registered URI error.

But now I am getting the: failed to fetch user profile error.

Thoughts?

b3ck commented 4 years ago

I found this, it might help : passport-twitch-new

@NGPixel would that be useful?

b3ck commented 4 years ago

This shouldn't be marked as help, this is a bug. The Twitch Login Strategy is broken and needs to be fixed. Thanks.

NGPixel commented 4 years ago

The help label is added automatically based on the issue type.

b3ck commented 4 years ago

Ahh... Copy that so.. any progress on this issue?

b3ck commented 4 years ago

Hello?