Пример #1
0
        private AuthenticationTicket CreatePocketTicketAsync(PocketAccessTokenResponse res)
        {
            var pocketIdentity = new ClaimsIdentity("OAuth");

            pocketIdentity.AddClaim(new Claim(ClaimTypes.NameIdentifier, res.UserName));
            pocketIdentity.AddClaim(new Claim("AccessToken", res.AccessToken));
            var user = new ClaimsPrincipal(pocketIdentity);
            AuthenticationProperties pocketProperties = new AuthenticationProperties();

            pocketProperties.AllowRefresh = true;
            return(new AuthenticationTicket(user, pocketProperties, "pocket"));
        }
 public static PocketAccessTokenResult Success(PocketAccessTokenResponse requestToken)
 {
     return(new PocketAccessTokenResult(true, requestToken, null));
 }
 public PocketAccessTokenResult(bool isSucess, PocketAccessTokenResponse pocketAccessTokenResponse, Exception exception)
 {
     IsSuccess = isSucess;
     PocketAccessTokenRespons = pocketAccessTokenResponse;
     Exception = exception;
 }