I am getting problem as I got the code and now I want access token in exchange of code but as pure google documentation to exchange code for token u need to send parameters
grant_type As defined in the OAuth 2.0 specification, this field must contain a value of authorization_code and by
var parameters = new OAuth2Parameters {
code =
ClientId = "",
ClientSecret = "",
RedirectUri = "",
Scope = "https://www.google.com/m8/feeds",
grant_type =,
};
OAuthUtil.GetAccessToken(parameters);
I am forming parameters but OAuth2Parameters doesn't contain definition for grant type and google send bad server request error. Can anyone please help me with the code to exchange code for access token and how to exchange that? This is the link in which it is said that in which form google url have to be made https://developers.google.com/accounts/docs/OAuth2WebServer#formingtheurl so kindly help me and if i pass to url withour grant type parameter then it sends error saying
Could not load file or assembly 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
If you look in the link you posted it gives you the answer:
grant_type As defined in the OAuth 2.0 specification, this field must contain a value of authorization_code.
Set the value to the literal string "authorization_code"
grant_type = "authorization_code",
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With