restish icon indicating copy to clipboard operation
restish copied to clipboard

Use loopback ip (127.0.0.1) instead of localhost

Open dreverri opened this issue 3 years ago • 5 comments

RFC8252 recommends using the loopback ip instead of localhost: https://datatracker.ietf.org/doc/html/rfc8252#section-8.3

Also, bind to an automatically chosen port rather than a fixed port.

dreverri avatar Dec 21 '21 21:12 dreverri

@dreverri thanks for the PR! I did not know that 127.0.0.1 is recommended over localhost, so thank you for that!

As for the random port, this seems to not work well with auth systems that require pre-registration of allowed callback URLs. Any thoughts on that?

danielgtaylor avatar Jan 17 '22 20:01 danielgtaylor

For example, see https://community.auth0.com/t/random-local-ports-on-redirect-uri/28623

danielgtaylor avatar Jan 17 '22 20:01 danielgtaylor

@danielgtaylor sorry for not getting back sooner. Regarding the port, it should probably default to its current value (8484) but allow the user to override it. A value of 0 would choose a random port.

dreverri avatar Feb 16 '22 04:02 dreverri

What's the best way to allow the user to configure the port?

dreverri avatar Feb 16 '22 04:02 dreverri

@dreverri you could try adding a --rsh-port parameter for this purpose!

danielgtaylor avatar Feb 24 '22 21:02 danielgtaylor

I actually tried to implement the 127.0.0.1 fix by itself, but it was breaking any OAuth server which didn't explicitly have 127.0.0.1 in the set of allowed redirect URLs. I'm going to close this for now and we should revisit if we can find a way to not break or when we are ready for some major breaking changes.

danielgtaylor avatar Jan 18 '23 05:01 danielgtaylor