Authorization code grant flow Dynamic port in redirect uri

Hi,

I am currently spawning a temporary webserver on the client so I set the redirect_uri to http://localhost:<port>.

The issue is, the port is not fixed, since I just ask the OS for a free port.
Is there a way I can have a dynamic redirect port on localhost?

Thanks
belst

Twitch only supports static Redirect URIs, so a random port would not be suitable for Twitch’s OAuth flows,

Depending on your use case, there are solutions such as using a reverse proxy which can act as your Redirect URI and that forwards the traffic on to whatever internal port you are using. Or you could use a static port.

There is a feature request on UserVoice for supporting any port on localhost, which you could upvote and add your use case to https://twitch.uservoice.com/forums/310213-developers/suggestions/45735790-allow-localhost-redirect-uri-to-work-regardless-of

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.