I am trying to add google sign in option in default .net mvc template project. As per many tutorials I tried to add the option but after redirecting to google sign in page and signing in it return backs to the default login page of the template as if nothing happened.
Things I've done so far to achieve this much,
.NET FRAMEWORK 4.5.2
copied the project url (SSL disabled) and pasted in redirect url with "/signin-google" attached.
created Auth2.0 client Ids as per the image attached,
pasted the ClientID and secret in
app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() { ClientId = "931587660641-s4smfbatgr1ufsq5u704qeigca22i8he.apps.googleusercontent.com", ClientSecret = "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" });
after attempting a few more times I've discovered the google sign prompt page actually sign in on thebrowser instead of the web app.
editor-screenshot Please help me find the solution and thanks in advance.
finally solved....!
Did just one thing to achieve this.
Set
SSL Enabled Status = True.Right Click the
Project,Go toProperties.Copy the
SSL URLin Project URL underWEBTab and click onCreate Virtual DirectoryButton next to it.Open Google API Credential and paste the URL under
Authorized JavaScript originslike thishttps://localhost:48428Copy the same URL and Paste under 'Authorized redirect URIs' with
/signin-googleat the end, like thishttps://localhost:48428/signin-googleCopy
ClientIDandClient Secret.Open Project , Go to
Startup.Auth.csunderApp_Startfolder.Uncommand the below code and Paste the copied codes here