안녕하세요 저는 Google 캘린더 API를 사용하려고합니다. 액세스 토큰을 얻을 수 없습니다.C# : Accesstoken을 얻을 수 없습니다. Google 캘린더 API
private string ObtainAccessToken(string code)
{
string content =
"code=" + code + "&" +
"client_id=1016429729591.apps.googleusercontent.com&"+
"client_secret={MySecret}&" +
"redirect_uri=urn:ietf:wg:oauth:2.0:oob&" +
"grant_type=authorization_code";//authorization_code";
Google.Apis.Authentication.HttpRequestFactory
factory = new Google.Apis.Authentication.HttpRequestFactory();
HttpWebRequest req = factory.Create(new Uri("https://accounts.google.com/o/oauth2/token?"+content), "POST");
byte[] data = Google.Apis.Utilities.EncodeStringToUtf8(content);
req.ContentLength = data.Length;
req.ContentType = "application/x-www-form-urlencoded";
req.GetRequestStream().Write(data, 0, data.Length);
req.GetResponse();
}
내가 소식 API 문서는 여기에 있습니다 : : https://developers.google.com/accounts/docs/OAuth2InstalledApp
내가 지속적으로 받고 있어요 HTTP 잘못된 요청 400 오류 여기
내가 현재 사용하고 코드입니다.는이 질문에 주어진 솔루션을 시도했지만 작동하지 않습니다 중 하나 Google Calendar API - Bad Request (400) Trying To Swap Code For Access Token
누군가가 지적 주실 래요 내가 잘못 여기서 뭘하는지?