Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid CSRF token: Too confusing for a User. #29

Open
BarryCarlyon opened this issue Jan 4, 2020 · 11 comments
Open

Invalid CSRF token: Too confusing for a User. #29

BarryCarlyon opened this issue Jan 4, 2020 · 11 comments
Labels
product: authentication ticketed Has been given an internal tracking ticket

Comments

@BarryCarlyon
Copy link
Contributor

Brief description

Occasionally, when you perform step 1 of oAuth (redirect user to Twitch to allow/deny an account link)

A JSON blob is returned in the body:

{"error":"Invalid CSRF Token"}

This is shown to a end user and the end user has no idea what to do.

How to reproduce

Keep trying to link accounts till it happens. Usually happens more often with Firefox users.

Expected behavior

Display a more useful error page, or redirect to Twitch login page, which you do get sometimes (even when logged in on Twitch)

@mauerbac mauerbac added the ticketed Has been given an internal tracking ticket label Mar 30, 2020
@mauerbac
Copy link

IDPLAT-3002

@guanzo
Copy link

guanzo commented Apr 30, 2020

Got a user complaint about this. +1

@marcandrews
Copy link

I also received a few user complaints about this.

@lleadbet
Copy link
Contributor

Hi everyone- thanks for the notes here.

If anyone is able to reproduce this consistently, any steps you can provide would help with resolution. Team is still investigating, however.

@BarryCarlyon
Copy link
Contributor Author

Firefox users report it often.

I don't have repro steps other than to be using firefox.

But whenver your code returns this error it needs to do something more useful than present this to the user

@vprime
Copy link

vprime commented Sep 27, 2020

This happens for me every time when trying to use Twitch SSO on Firefox. I do not have issues when using other SSO+MFA services like Google.

The steps I take are:

  1. Start Firefox (I have uBlock Origin, and NoScript but disabling them does not help)
  2. Log into twitch account with MFA through Authy
  3. Visit website using Twitch SSO, like DNDBeyond.com
  4. Click "Login in with twitch"
  5. Authorize the application
  6. Upon pressing "Authorize" I am presented with the page "https://id.twitch.tv/oauth2/authorize" in JSON format with {"status":401,"message":"invalid csrf token"}

My workaround has been

  1. Launch Google Chrome
  2. Log into my Twitch Account
  3. Sign into the website, and authorize my twitch account
  4. Set up an alternative method of logging in.
  5. Close chrome, and reopen Firefox.
  6. Sign on with anything but Twitch SSO

@Higler
Copy link

Higler commented Apr 10, 2024

I was having this same issue in Brave and Chrome browser. Tried logging out and back in multiple times, tried clearing cache and cookies multiple times in both browsers. Was not able to solve this issue until I logged into twitch via mobile (brave browser) then clicked authorize and it worked flawlessly. Not able to recreate the issue since making the connection but this is what solved the issue for me.

@thatmaxplayle
Copy link

This is completely preventing me from implementing Twitch connections to my website!

@Bus42
Copy link

Bus42 commented Nov 3, 2024

I am having the same issue with Google Chrome. I have read a dozen other threads, logged out and back in, cleared cookies, cleared site data, and every other suggestion I've found but it's still the same. No matter what I try to connect to Twitch its the same error:

{
status: 401,
message: "invalid csrf token"
}

I do not have ad blockers or use a VPN and this is a problem I have only encountered with Twitch.

@Bus42
Copy link

Bus42 commented Nov 3, 2024

Here's what actually worked for me:

  1. Do not try from Streamlabs Desktop
  2. Log in to Streamlabs in your browser
  3. Add connections from there.

I would suggest either disabling this feature in the desktop client until it has been resolved or including a message that this may not work from desktop and to try from the browser.

@BarryCarlyon
Copy link
Contributor Author

I would suggest either disabling this feature in the desktop client until it has been resolved or including a message that this may not work from desktop and to try from the browser.

TwitchDev isn't support for Streamlabs Desktop, so you'll have to talk to them about disabling it in their desktop client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: authentication ticketed Has been given an internal tracking ticket
Projects
None yet
Development

No branches or pull requests

10 participants