Google Log in Issue in published website but fine in dev mode

时光毁灭记忆、已成空白 提交于 2019-12-12 04:28:07

问题


I am working on one of the log in form in ASP.Net MVC 5. And the google login is not working properly. When I run the project as localhost I am able to redirect to the google's log in page. But when I publish the website I get error as Error: redirect_uri_mismatch. I am new to all this please guide me. below is code snippet.

   var ClientID = "*************";
    var url = "https://accounts.google.com/o/oauth2/auth?";
    var parameters = "response_type=code&client_id=".concat(ClientID).concat("&redirect_uri=@(HttpUtility.UrlEncode(SimUtils.UrlForGoogleAuth))" + "&scope=openid%20email&");
    var loginUri = url.concat(parameters);
    window.open(loginUri);

I don't even know where to look as it is working correctly when I ran in localhost. Please help me.

来源:https://stackoverflow.com/questions/41270512/google-log-in-issue-in-published-website-but-fine-in-dev-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!