XenorPLxx / playnite-library-nintendo

Playnite library extension for Nintendo.
MIT License
8 stars 1 forks source link

Authentication Not Recognized for 2 Factor Nintendo Users #5

Open patrick-theprogrammer opened 11 months ago

patrick-theprogrammer commented 11 months ago

First off thanks for this awesome add on! Enjoying it.

Im a developer by trade and just now getting into open source powershell and c# development, so I did some detailed analysis and might have time to take a stab at a fix myself if you’d like.

Describe the bug Nintendo has issues honoring a full path post_login_redirect_uri url parameter when the user has two factor authentication enabled. It only reads the path and I guess hardcodes the domain, I ended up getting redirected to accounts.nintendo.com/my/ instead of the intended API domain ec.nintendo.com/my/.

This means that the token json file doesn’t get created since the login is recognized as successful based on the web view loading the redirect url.

A simple fix might be to just consider accounts.nintendo.com/my as the user being logged in in the web view. Or more thorough check the cookies on each web view change until some Nintendo auth ones are there.

To Reproduce Enable 2 factor authentication on your Nintendo account. Reinstall the addon or delete the token file, try to authenticate with that account. Personally I tried authenticator and passkey based methods, I’m assuming this issue would be the same for an SMS based method too. Note page not found error and the addon not recognizing you are authenticated.

Workaround As a workaround if I create an empty token.json file in the addon data directory and then restart playnite, everything WAI afterwards.

Diagnostics ID Please generate diagnostics package from "About Playnite" menu and attach identifier you received. If the issue is a crash bug, you can generate diag. package directly from crash dialog. f5a5149c-3a35-45ee-b848-f8838bfb51a0

XenorPLxx commented 11 months ago

Thanks for the detailed report, I'll try to implement at least the simple fix shortly and release it.

vitaminj commented 10 months ago

I worked around this by right-clicking and pressing back a couple of times and then the N website got to an earlier page, realised it was logged in and auto-redirected to the ec.nintendo domain that the plugin expected

celticsamurai commented 8 months ago

I've tried both workarounds, and they don't seem to work for me. The blank json doesn't seem to change anything, and I'm not able to go back with right clicking on the webpage when it asks to log in.

CuddleBear92 commented 6 months ago

just to comment on this one. the workaround worked fine. just login with your 2FA or Passkey and then right click and click back a couple of times until you get to the ec.nintendo.com/my/ page and it will automatically close the window and log you in.

8-BitAnt commented 5 months ago

I am also having issues getting this to work no matter what I do... any other workarounds?

XenorPLxx commented 5 months ago

I've released a new version that should work: https://github.com/XenorPLxx/playnite-library-nintendo/releases/tag/1.7 If you'll still have issues, you might need to go to plugins/installed/libraries/nintendo, click data folder and remove token.json, go to Playnite/settings/advanced, click clear web cache. Playnite will then restart and you should be able to log in successfully. During testing, I had to do that on my main Playnite, but for dev instances it wasn't necessary.

koelle25 commented 4 months ago

I've released a new version that should work: https://github.com/XenorPLxx/playnite-library-nintendo/releases/tag/1.7 If you'll still have issues, you might need to go to plugins/installed/libraries/nintendo, click data folder and remove token.json, go to Playnite/settings/advanced, click clear web cache. Playnite will then restart and you should be able to log in successfully. During testing, I had to do that on my main Playnite, but for dev instances it wasn't necessary.

Thank you! I can report that this procedure worked for me 😃

Dobbelklick commented 4 months ago

Same problem here and I'm using version 1.7. It worked for one connection after installation and now I can't authenticate anymore. It asks for password, 2FA and all, but won't change to "authenticated". I'm using a German Nintendo account if it matters. Workaround with empty token.json works though.

edit: And It's unauthorized again... :(

jaredcat commented 2 months ago

go to plugins/installed/libraries/nintendo, click data folder and remove token.json, go to Playnite/settings/advanced, click clear web cache. Playnite will then restart and you should be able to log in successfully.

Did not work for me. After using 2FA code the window closes, after a few seconds the plugin returns to saying Requires authentication

XenorPLxx commented 2 months ago

Yea seems like Nintendo broke something again, ill investigate