Google signIn is ignoring authorized Redirect URI's

309 views Asked by At

I created a Google Cloud project to use the new Google sign in functionality, I added http://localhost:5000 as the only authorized redirect URI under the Oauth 2.0 credentials manager (for testing purposes obviously), however when I write the HTML for the button, I can put any data-login_uri an it will redirect to that URI after a succesfull login.

I was expecting a redirect_uri_mismatch error when I tried to change that URI but its not happening, it will redirect to any URI i put there. I'm not sure if I'm misunderstanding the functionality of the "Authorized redirect URIs", if its something that doesn's get evaluated when the origin is a localhost, or if I'm missing something else. Thanks.

[EDIT] This is the code snippet to display the button

<div class="form-row">
    <script src="https://accounts.google.com/gsi/client"></script>
    <div id="g_id_onload"
        data-client_id="xxxxx"
        data-login_uri="https://www.example.com"
        data-auto_prompt="false">
    </div>
    <div class="g_id_signin"
        data-type="standard"
        data-size="large"
        data-theme="outline"
        data-text="sign_in_with"
        data-shape="rectangular"
        data-logo_alignment="left">
    </div>

localhost:5000 is the only URI on my project "Authorized redirect URIs " configuration, so, if I'm redirecting to any place but localhost:5000 I should get a redirect_uri_mismatch error right?

0

There are 0 answers