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

401 Unauthorized #25

Closed
godd9170 opened this issue May 23, 2023 · 8 comments
Closed

401 Unauthorized #25

godd9170 opened this issue May 23, 2023 · 8 comments

Comments

@godd9170
Copy link

godd9170 commented May 23, 2023

I've followed the setup guide in the readme, and upon clicking the 'Login' button, I'm taken to the /login route with the message 401 Unauthorized displayed. Unfortunately there is not much in the way of logs to troubleshoot even when I run with npx remix dev --debug. I see there are plenty of debug lines in the source code, so If you could share how to see those, it might unblock me.

What's more, is that the live demo you link in the readme also faces this same issue.

Screenshot 2023-05-22 at 10 20 38 PM

Edit:

I was able to use an ErrorBoundary to see that it's a 32 error from Twitter at play.

Screenshot 2023-05-22 at 10 28 04 PM
@na2hiro
Copy link
Owner

na2hiro commented May 28, 2023

Thanks for the report. I confirmed that the live demo apps has been suspended due to policy violation 😅 . However, my app which uses this library is working fine.

Could you check your app's status from the Twitter's Developer Portal? https://developer.twitter.com/en/portal/dashboard

@rgmvisser
Copy link

@godd9170 FWIW I had the same issue and created a "standalone app" this made it work for me. Looks like you can't use the v2 API that way, but we are only using it for authentication.
https://developer.twitter.com/en/portal/projects-and-apps
Screen Shot 2023-05-30 at 18 29 32

@na2hiro
Copy link
Owner

na2hiro commented Jun 16, 2023

My suspect is that it has V1.1 verify_credentials call after getting access token, and that can cause a problem. In my app, that step started to cause a timeout.

I made a quick PR #26. I'll try to publish this as an alpha so people can try this version later today.

@na2hiro
Copy link
Owner

na2hiro commented Jun 17, 2023

Published v2.0.0-0 https://github.com/na2hiro/remix-auth-twitter/releases/tag/v2.0.0-0 for the changes above. Note that this is a pre-release and you need to manually specify npm i remix-auth-twitter@2.0.0-0 in order to install. @godd9170 Can you try with this?

I see there are plenty of debug lines in the source code, so If you could share how to see those, it might unblock me.

Sorry I missed this part. It's from debug npm module and running with DEBUG=TwitterStrategy environment variable would print out which steps it gets.

@na2hiro
Copy link
Owner

na2hiro commented Jun 20, 2023

^ Although it worked for me for a while, it doesn't seem to work now. 401 is returned after "Fetch access token" debug message, returned by OAuth 1.0a access token URL (/oauth/access_token)

I still don't fully understand (and some help for references would be appreciated here), but I'll try to implement another strategy with OAuth 2.0 and see if that would work

@na2hiro
Copy link
Owner

na2hiro commented Jul 3, 2023

I've published an official major release 2 https://github.com/na2hiro/remix-auth-twitter/releases/tag/v2.0.0. When you have time please check if this works for you

@godd9170
Copy link
Author

Hi @na2hiro I apologize for going dark on this. It's part of a side project that I'd abandoned. I'll try the new release in one of the upcoming weeks, but if you want to close this issue so your backlog is pristine I'd have no issues with that.

@na2hiro
Copy link
Owner

na2hiro commented Jul 25, 2023

Thanks for the update. I'll close this for now. Let me know if it still doesn't work

@na2hiro na2hiro closed this as completed Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants