1
MVC5 앱에서 간단한 Google+ 인증을 구현했으며 Google 캘린더에 액세스하고 싶습니다. MVC ID 시스템과 이미 인증 된 사용자를 사용하여이 작업을 수행하려면 어떻게해야합니까?Google 캘린더에 이미 인증 된 세션을 사용하려면 어떻게해야하나요?
Dim authGOps = New GooglePlusAuthenticationOptions() With {
.Caption = "Google+",
.ClientId = "MYCLIENTRID",
.ClientSecret = "MYCLIENTSECRET",
.Provider = New GooglePlusAuthenticationProvider() With {
.OnAuthenticated = Async Function(context)
context.Identity.AddClaim(New Claim(GooglePlusAccessTokenClaimType, context.AccessToken))
End Function
}
}
authGOps.Scope.Add("https://www.googleapis.com/auth/calendar")
app.UseGooglePlusAuthentication(authGOps)
달력 서비스 받기 : 그래서
Dim calendarService = New CalendarService(New Google.Apis.Services.BaseClientService.Initializer() With {
WHAT GOES HERE TO AUTHENTICATE USING MY OLD AUTH CEDENTIALS?
}