Error on redirect after authorization

Hello guys, I am at the point in the twitch authorization wherein twitch sends me back a code.

I don’t have everything set up yet and neither am I working with ejs. But just so I can understand the reason behind the error: After having authenticated once (or the first time) the second time around I head over to the authentication route, the browser returns with an “This site cannot provide a secure connection” error and does not load the page. However, in the URL I am still being sent back the code.

Would really appreciate it if someone can help me understand what’s going on. Thank you!

This suggests a problem with your SSL Certificate.

Not a problem with the oAuth API itself

So that means I will need to install an SSL certificate and use it to run my server locally. Is that correct?

For localhost you can’t do SSL without faff

For live/production you need SSL yes

What’s faff?

faff/dumb shit/faffery/annoying stuff.

SSL On “localhost” involves self signed certs.
But you don’t need SSL when operating on localhost anyway (for oAuth)

If I don’t need one for localhost, does that suggest that installing SSL certificate will not fix the issue I’m currently experiencing?

Okay, so after switching the redirect URL from https to http, I am receiving a different error:

‘InternalOAuthError: failed to fetch user profile’

may fix

that’s the best fix for localhost

That is not an “API” error thats an interrpeted library error. So I don’t know what the issue is. Sicne I don’t know what code you are using.

For PHP I run this:

Much easier as I’m not playing “whats the error the library did”

I’m using node with passport library.

Sorry I confused you with someone else I was helping

Passport is fun and I avoid it since I jsut don’t need it.

I’m assuming you are using passport-twitch-new - npm as your strat as it’s more up to date than passport-twitch

For my node stuff I run: just express and got, (got for HTTP calls)

1 Like

Right, so after you have pointed out that the library I was using was outdated, I used the new one. And it’s working… better, now Twitch is returning the profile information through console.log, but the browser is returning a different error: “InternalOAuthError: Failed to obtain access token”

Then you need to refer to the documentat and support routes for passport/the strategy. Which is generally outside the scope of this forum since it’s a specific library problem now

Okay, thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.