forwardUrl not redirecting for non http/https urls (eg. my-app://plex for Third Party Mobile CLient)

Hi There,

I have followed the process outlined in Authenticating With Plex. This works for the most part except when I generate a URL and open it in the browser for authentication.

https://app.plex.tv/auth#?clientID=<clientIdentifier>&code=<pinCode>&context%5Bdevice%5D%5Bproduct%5D=My%20Cool%20Plex%20App&forwardUrl=https%3A%2F%2Fmy-cool-plex-app.com

My issue is with the parameter forwardUrl. As I understand it, if I mention a forwardUrl then once authenticate it should redirect the browser to the given url.

This works perfectly if I mention a URL with the http:// or https:// scheme (i.e. a vanilla webpage on the internet). However, if I give a custom scheme my-app:// it does not work. in fact, it does not even show me the login screen, it just redirects me away to https://plex.tv.

I have this custom scheme, so that it redirects back to the iOS or Android app once authentication has completed.

Are non http:// or https:// url schemes within forwardUrl blocked. It is odd, because I have seen a few apps actually use this (e.g. Infuse 7 on the iOS App Store). They use the intent infuse-oath://plex. And it just works.

My current workaround is to host a static webpage, that then opens up the custom intent url.

Yes, custom protocols are not supported. Only http and https may be used.

Infuse’ custom protocol is a special-case. Originally forrwardUrl supported arbitrary protocols but when we saw javascript:-protocol-flavored URLs, we restricted the supported protocols to a small, fixed list.

Thanks for the reply and confirmation. This possibly saved me a few more hours.

Saved me hours too, I just wish I had found this before I spent hours on it :slight_smile:

I am using the plex-oauth package and I was trying to redirect back to a local electron app with a registered local protocol :slight_smile:

I have a Plex app for the Vision Pro and would love to utilize this method of authentication. Is there anything I can do to get my app on that list?