2014-07-16 4 views
1

내 클라이언트 ID 및 클라이언트 비밀번호를 사용하여 Gmail API로 내 웹 앱을 인증하려고합니다. here에 위치한 "빠른 시작"예제의 인증은 이상하게 복잡해 보입니다. 그러나 4 단계에서는Gmail API에 로그인

참고 :이 예제의 권한 흐름은 데모 목적으로 크게 단순화되었으므로 웹 응용 프로그램에서 사용하면 안됩니다. 자세한 내용은 Authorizing your App with Gmail을 참조하십시오.

그러나 제공된 링크는 깨졌습니다. 누구나 성공적으로 C#의 Gmail API에 대한 간단한 인증을 만들었습니까?

나는이 질문에 답을 찾을 수없는 다른 사람들을위한 자원이 될 수 있도록이 질문을 주로하고 있습니다. 는 C# 인증이 같은 시도에 대한 https://developers.google.com/gmail/api/auth/about-auth

:

+1

를, 구글은이 URL 나왔다 : https : //로 개발자. google.com/gmail/api/auth/about-auth 도움이되기를 바랍니다. –

+0

일부 예제가 파이썬으로 제한되는 이유는 무엇입니까? :( – muttley91

답변

3

깨진 링크해야 내가 링크 자체를 검색

// Create OAuth Credential. 
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
    new ClientSecrets 
    { 
     ClientId = "CLIENT_ID", 
     ClientSecret = "CLIENT_SECRET" 
    }, 
    new[] { GmailService.Scope.GmailModify }, 
    "user", 
    CancellationToken.None).Result; 

// Create the service. 
var service = new GmailService(new BaseClientService.Initializer() 
{ 
    HttpClientInitializer = credential, 
    ApplicationName = "Draft Sender", 
}); 

ListDraftsResponse draftsResponse = service.Users.Drafts.List("me").Execute(); 
관련 문제