protected override Task <GoogleUserInfo> GetUserInfoFromContext(OAuthCreatingTicketContext ctx)
 {
     GoogleIdgeneral = ctx.GetGoogleId();
     return(Task.FromResult(new GoogleUserInfo
     {
         RefreshToken = ctx.RefreshToken,
         Email = ctx.GetEmail(),
         GoogleId = ctx.GetGoogleId()
     }));
 }
Esempio n. 2
0
 public void CreateOrUpdateUser(OAuthCreatingTicketContext context)
 {
     if (context.RefreshToken != null)
     {
         _userService.CreateOrUpdateGoogleUser(context.GetEmail(), context.GetGoogleId(), context.RefreshToken);
     }
 }
        protected override Task <GoogleUserInfo> GetUserInfoFromContext(OAuthCreatingTicketContext ctx)
        {
            //using( HttpClient httpClient = new HttpClient())
            //{
            //     httpClient.GetAsync("https://www.googleapis.com/plus/v1/people/me?personfilels=Birthdates");
            //};


            return(Task.FromResult(new GoogleUserInfo
            {
                RefreshToken = ctx.RefreshToken,
                Email = ctx.GetEmail(),
                GoogleId = ctx.GetGoogleId()
            }));
        }
Esempio n. 4
0
 public User FindUser(OAuthCreatingTicketContext context)
 {
     return(_userService.FindGoogleUser(context.GetGoogleId()));
 }