Example #1
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)
 {
     return(Task.FromResult(new GoogleUserInfo
     {
         RefreshToken = ctx.RefreshToken,
         Email = ctx.GetEmail(),
         GoogleId = ctx.GetGoogleId()
     }));
 }
 protected override Task <FacebookUserInfo> GetUserInfoFromContext(OAuthCreatingTicketContext ctx)
 {
     return(Task.FromResult(new FacebookUserInfo
     {
         RefreshToken = ctx.AccessToken,
         Email = ctx.GetEmail(),
         FacebookId = ctx.GetFacebookId()
     }));
 }
        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()
            }));
        }
 public User FindUser(OAuthCreatingTicketContext context)
 {
     return(_userService.FindUser(context.GetEmail()));
 }
 public void CreateOrUpdateUser(OAuthCreatingTicketContext context)
 {
     _userService.CreateOrUpdateGithubUser(context.GetEmail(), context.GetGithubId(), context.AccessToken);
 }