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

User token not generated #143

Closed
shaloonigam opened this issue Mar 7, 2022 · 5 comments · Fixed by #149
Closed

User token not generated #143

shaloonigam opened this issue Mar 7, 2022 · 5 comments · Fixed by #149
Labels
bug Something isn't working enhancement New feature or request

Comments

@shaloonigam
Copy link

shaloonigam commented Mar 7, 2022

After registering my app with a redirect URI of http://localhost:3000, I tried to generate a user token but no response on console.
I am using macOS Big Sur and Google chrome.

Followed the below steps:

  1. twitch configure >> added the client id and secret >> Updated configuration.
  2. twitch token -u -s “user:read:email”
  3. Redirected to app for authorization >> authorized it
  4. The browser displays "Feel free to close this browser window." but no response on console, it still shows "Opening browser. Press Ctrl+C to cancel..."
  5. On refreshing web browser, I get "This site can’t be reached localhost refused to connect."

How to get the user token? What am I doing wrong?

@Aberen
Copy link

Aberen commented Mar 7, 2022

Getting the same thing, unfortunately, following for fix.

@lleadbet
Copy link
Contributor

lleadbet commented Mar 7, 2022

Just to help triage can you post:

  • OS
  • Browser

Additionally, what are you seeing after completing the flow in the browser- are you getting the "Feel free to close this browser window"? If you are, if you refresh, does it help or no?

@lleadbet lleadbet added the bug Something isn't working label Mar 7, 2022
@Aberen
Copy link

Aberen commented Mar 8, 2022

  • OS: macOS 11.4
  • Browser: Chrome Version 99.0.4844.51
  • Installed via homebrew

$twitch token -u -s "channel:manage:redemptions user:edit:follows"

Chrome opens up, when I press the 'continue' button. I get greeted with the 'Feel free to close this browser window.' and when I look in the terminal, the user token is blank.

2022/03/08 10:00:08 User Access Token: [blank]

Additionally, if I wait a few seconds without pressing 'continue' the terminal dies with the message 'state mismatch'.

EDIT: I now also see, the URL after pressing continue is /auth?error=redirect_mismatch&error_description=Parameter+redirect_uri+does+not+match+registered+URI&state=

@Aberen
Copy link

Aberen commented Mar 14, 2022

Just tried with with one of my other machines. A Windows 10 machine. Twitch-cli installed via Scoop. Same issue.

@lleadbet
Copy link
Contributor

lleadbet commented Apr 5, 2022

The specific issue is that your redirect is not matching http://localhost:300 per https://github.com/twitchdev/twitch-cli/blob/main/docs/token.md; it may be nice to expose this to the user, however.

Will mark this as a feature enhancement as a result.

@lleadbet lleadbet added the enhancement New feature or request label Apr 5, 2022
@lleadbet lleadbet linked a pull request Apr 7, 2022 that will close this issue
4 tasks
@Xemdo Xemdo closed this as completed in #149 Apr 7, 2022
Xemdo added a commit that referenced this issue Apr 7, 2022
…rovements-login

bubbling up login errors to improve UX; helps with #143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants