google authentication question
so i am trying to login to my app with google, and it always gives me error 500 whenever I do. I added the redirect uri to the google console already, yet it wont let me signin. it works fine locally in docker so not sure what the issue is.
18 Replies
and then the deployed app : https://realtime-poll.onrender.com
check your app logs
First try with http instead of https:
and use redirecturl with a trailing
/
.
In your case: https://realtime-poll.onrender.com/signin-google/
instead of https://realtime-poll.onrender.com/signin-google
.ok
i checked my app logs and it says:
doesnt let me add http as a redirect uri, it says
oh
one sec
Is it in production?
yes but changed it to testing but im not sure if that was good to do
it allowed me to add the http but not sure if that was how i was supposed to do it
Does it work now with http? It is only for troubleshooting.
yes it works now
It seems you have a problem with https certificate or forwarding issue.
yeah im not sure why im not realy sure why it redirects me to http instead of https as the redirect uri .i thought maybe it was my program.cs configuration but im not really sure
Keep trying because you and I both have the same issue. 🙂 I am still figuring out what happens by reading many articles on the internet.
oh ok
i tried something liek this and i was able to get to login but the login itself still didnt work
i dont reallt know what any of this stuff means unfortunately im new to .net and i dont really understand all this http https ssl stuff tbh
app.UseHttpsRedirection();
and apparently this line in program.cs should fix the issue but it doesnt
hey i think i fixed it. all i did was added app.UseAuthentication();
to program.cs. in this order: In my simplest test project, I remove all of the following:
But I enable the following
and using
var redirectUrl = "https://localhost:7000/signin-google/";
that matches exactly the settings I specified in Google's Cloud Console.
Finally my endpoint app.MapGet("signin-google", ...);
is successfully invoked by Google's OAuth redirection. 🙂 @Aresthats good. i dont really understand what most of that means but glad you were able to fix it lol. i also added /signin google to GCC, maybe thats what fixed it
It means the issue is only about forwarding header no matter we enable authentication/authorization middleware.
im super late but thanks lol