<p></p>
<p dir="auto">I understand your concerns.</p>
<p dir="auto">OAuth RFC does in fact <a href="https://datatracker.ietf.org/doc/html/rfc8252#section-7.3" rel="nofollow">recommend not to use localhost</a>, but use <code class="notranslate">127.0.0.1</code> instead.</p>
<p dir="auto">However, due to:</p>
<ul dir="auto">
<li>Improved developer experience (easy, flexible)</li>
<li>Small attack surface</li>
</ul>
<p dir="auto">using the <code class="notranslate">localhost</code> loopback address for OAuth callbacks during development is a common accepted approach:</p>
<p dir="auto"><a href="https://developers.google.com/identity/protocols/oauth2/web-server#uri-validation" rel="nofollow">Google</a><br>
<a href="https://learn.microsoft.com/en-us/entra/identity-platform/reply-url#supported-schemes" rel="nofollow">Microsoft</a><br>
<a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authorization-endpoint.html" rel="nofollow">Amazon</a><br>
I'm sure I could find many more.</p>
<p dir="auto">I updated so that <code class="notranslate">localhost</code> and <code class="notranslate">127.0.0.1</code> are hardcoded, so devs should not get the idea to extend to additional domains in the future.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4287#issuecomment-1852212018">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJAUQV74MZTIFOCATDYJBWZ5AVCNFSM6AAAAAA55LRREWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGIYTEMBRHA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMPHBJV4SVTYD4UHUTYJBWZ5A5CNFSM6AAAAAA55LRREWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTOM2BTE.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4287/c1852212018</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4287#issuecomment-1852212018",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4287#issuecomment-1852212018",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>