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

PLEX Oauth Doesn't Seem To Work? #2485

Closed
firrae opened this issue Aug 30, 2018 · 10 comments
Closed

PLEX Oauth Doesn't Seem To Work? #2485

firrae opened this issue Aug 30, 2018 · 10 comments

Comments

@firrae
Copy link

firrae commented Aug 30, 2018

Ombi build Version:

V 3.0.3587

Update Branch:

master

Media Sever:

Plex

Media Server Version:

Latest

Operating System:

Unraid (Linux)

Ombi Applicable Logs (from /logs/ directory or the Admin page):


Nothing seems to be captured? I see no logs for anything recent, only an issue I had months ago.

Problem Description:

When I enable Plex Oauth the button appears as expected, but when it's pressed nothing happens other than a delayed notification that says "Authenticating Loading... Please Wait". Once I log in using the Imported Plex users via the normal Ombi login that notificaiton will keep appearing. If I don't try to auth with PLEX that notification never appears.

I have left the login trying to "load" for over an hour now with no obvious progress or error logged.

Reproduction Steps:

See above. Otherwise I just installed using the linuxserver.io Docker image.

Any help in troubleshooting is greatly appreciated.

@tidusjar
Copy link
Member

tidusjar commented Aug 30, 2018 via email

@dotsam
Copy link

dotsam commented Aug 30, 2018

This is an issue in both Chrome and Safari for me as both browsers’ default behaviour is to block popups that aren’t a direct result of a user action. In this case, the window.open in the login component is called in a callback nested two deep, so browsers don’t see it as being a direct result of user actions.

The workaround is to either open the popup first and then change the location of that window after you have the Plex OAuth URL, or to open the window to an endpoint that will run the whole flow there.

@firrae
Copy link
Author

firrae commented Aug 31, 2018

Interesting, I will double check this out this weekend. I don't remember the pop-up block thing showing up, but I also didn't look for it specifically.

@dotsam
Copy link

dotsam commented Aug 31, 2018

Browsers may have different rules for localhost as well, which is why you may not have seen it if you’re not checking on an external instance.

On Chrome, the location bar at least shows the “popup blocked” icon that you can click on to whitelist the site, but in Safari, the popup is silently blocked with no notification, so I was initially very confused about what was supposed to happen when first trying to use OAuth.

@zackpollard
Copy link

Can confirm that I'm also experiencing this behaviour on chrome on windows and safari on MacOS. Chrome at least shows the pop-up was blocked but I don't believe safari does.

@weinberz
Copy link

weinberz commented Sep 4, 2018

Chiming in to say that I'm also experiencing this with Chrome on macOS. Seems to be a recent regression, as this was working in the last couple of weeks.

Note that if I disable popup blocking on the ombi site through chrome, the popup comes on fine and my device is able to easily connect.

@firrae
Copy link
Author

firrae commented Sep 5, 2018

This does seem to be the issue @tidusjar and @dotsam. I just never noticed it when I first tried it. Is there a way to look into solving this? It would make sense the button press is a user action so shouldn't the browser not block that?

@dotsam
Copy link

dotsam commented Sep 13, 2018

@tidusjar Modern browsers will block a window.open call that isn't a direct synchronous result of a user interaction. More details here: https://javascript.info/popup-windows#popup-blocking

In short, the window.open call from the login component needs to happen immediately in the oauth() method and not in the callback from another method. You'll need to store the handle of the opened window and change the URL once it's available. There's an overly-simplified example here: https://gist.github.com/jayphelps/dc8556e72caaf8b2ac5596afcf91498d

tidusjar added a commit that referenced this issue Sep 18, 2018
@tidusjar
Copy link
Member

Fixed in develop, please can someone confirm.

Thanks for the advice @dotsam

@dotsam
Copy link

dotsam commented Sep 19, 2018

Tested and working in Chrome and Safari for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants