I am trying to connect to Google through OAuth2. I am using code that works in another application, so I am pretty sure that the problem is with the configuration on Google.
I registered the client ID and secret key in the Google console, which I added to the authorization configuration:
var client = new GoogleOAuth2Client("[client id].apps.googleusercontent.com", "[secret key]");
var extraData = new Dictionary<string, object>();
OAuthWebSecurity.RegisterClient(client, "Google", extraData);
Unfortunately, when I click the button to connect, I get the following error:
- This is mistake.
Error: invalid_request
Invalid parameter value for redirect_uri: No authority: file: /// Account / ExternalLoginCallback% 3FReturnUrl = /
Request details
scope = https://www.googleapis.com/auth/userinfo.profile
https: // www. googleapis.com/auth/userinfo.email
response_type = code
redirect_uri = File: /// Account / ExternalLoginCallback% 3FReturnUrl = /
state = provider = Google & s.d.strong> = [number] client_id = [client id] .apps.googleuserconte
I tried changing the localhost parameter in the file /etc/hoststo other base URLs, and I added these places to redirect the URIs in Google Console as follows:
http:
http:
http:
. , , , - .