I made an app that uses OAuth to authenticate and then later use the Plex API, it worked well until pretty recently. I was already authenticated in my app but requests weren’t working. I’ll figure out why local API requests are failing after I figure out auth again.
SO I cleared the auth token I had cached and went to trigger oauth again to get a fresh one., first it (seemingly successfully) fetches a code and id from:
https://plex.tv/api/v2/pins.json?strong=true
Then builds a URL to open to do the authentication:
https://app.plex.tv/auth#?context[device][product]=Posterizer&context[device][environment]=bundled&context[device][layout]=desktop&context[device][platform]=Web&context[device][device]=Posterizer%20(Web)&clientID=xxxxxxxxxx&forwardUrl=xxxxxxxxx&code=whhyc7wan68k1n1uil3xxxxxx
(I replaced some stuff with xxxxx for this post)
Here’s how I built that URL:
var login_url =
'https://app.plex.tv/auth#' +
`?context[device][product]=${product}` +
'&context[device][environment]=bundled' +
'&context[device][layout]=desktop' +
`&context[device][platform]=${platform}` +
`&context[device][device]=${encodeURI(device)}` +
`&clientID=${clientId}` +
`&forwardUrl=${redirectUri}` +
`&code=${code}`;
When the URL opens in a browser window it says “We were unable to complete this request. You will be redirected automatically.” and redirects me to the plex homepage (which for the record isn’t my forwardURL)
Did something change with oauth recently? I notice in THIS POST that recently a Plex Employee was trying to track down a “We were unable to complete this request.” problem, but the context of the issue is slightly different. I disabled 2FA on my account to see if that for some weird reason would do anything, it didn’t. I tried logging out of Plex then trying the flow, didn’t work. I’ve tried on more than one computer. I don’t really know what else to try as my oauth flow has been working great since I wrote it back in June but now it just isn’t.
I’d appreciate any assistance I can get.
Thanks,
Zac

