/// <summary> /// /// </summary> /// <param name="context"></param> public void Create(AuthenticationTokenCreateContext context) { var clientid = context.Ticket.Properties.Dictionary["as:client_id"]; if (string.IsNullOrEmpty(clientid)) { return; } var refreshTokenId = Guid.NewGuid().ToString("n"); var refreshTokenLifeTime = context.OwinContext.Get <string>("as:clientRefreshTokenLifeTime"); var token = new AuthenticationRefreshToken { Id = HelperMethods.GetHash(refreshTokenId), Clientid = clientid, Subject = context.Ticket.Identity.Name, Issuedutc = DateTime.UtcNow, Expiresutc = DateTime.UtcNow.AddMinutes(Convert.ToDouble(refreshTokenLifeTime)) }; context.Ticket.Properties.IssuedUtc = token.Issuedutc; context.Ticket.Properties.ExpiresUtc = token.Expiresutc; token.Protectedticket = context.SerializeTicket(); AuthenticationRefreshTokenService.Save(token); context.SetToken(refreshTokenId); }
public void Update(AuthenticationRefreshToken entity) { AuthenticationRefreshTokenRepository.Update(entity); }
public string Save(AuthenticationRefreshToken entity) { return(AuthenticationRefreshTokenRepository.Save(entity)); }
public void Delete(AuthenticationRefreshToken entity) { AuthenticationRefreshTokenRepository.Delete(entity); }
/// <summary> /// /// </summary> /// <param name="context"></param> public void Create(AuthenticationTokenCreateContext context) { var clientid = context.Ticket.Properties.Dictionary["as:client_id"]; if (string.IsNullOrEmpty(clientid)) { return; } var refreshTokenId = Guid.NewGuid().ToString("n"); var refreshTokenLifeTime = context.OwinContext.Get<string>("as:clientRefreshTokenLifeTime"); var token = new AuthenticationRefreshToken { Id = HelperMethods.GetHash(refreshTokenId), Clientid = clientid, Subject = context.Ticket.Identity.Name, Issuedutc = DateTime.UtcNow, Expiresutc = DateTime.UtcNow.AddMinutes(Convert.ToDouble(refreshTokenLifeTime)) }; context.Ticket.Properties.IssuedUtc = token.Issuedutc; context.Ticket.Properties.ExpiresUtc = token.Expiresutc; token.Protectedticket = context.SerializeTicket(); AuthenticationRefreshTokenService.Save(token); context.SetToken(refreshTokenId); }
/// <summary> /// </summary> /// <param name="entity"></param> public void Update(AuthenticationRefreshToken entity) { CurrentSession.Update(entity); }
/// <summary> /// </summary> /// <param name="entity"></param> /// <returns></returns> public string Save(AuthenticationRefreshToken entity) { return (string) CurrentSession.Save(entity); }
/// <summary> /// </summary> /// <param name="entity"></param> public void Delete(AuthenticationRefreshToken entity) { CurrentSession.Delete(entity); }
public string Save(AuthenticationRefreshToken entity) { return AuthenticationRefreshTokenRepository.Save(entity); }
/// <summary> /// /// </summary> /// <param name="entity"></param> public void Update(AuthenticationRefreshToken entity) { CurrentSession.Update(entity); }
/// <summary> /// /// </summary> /// <param name="entity"></param> /// <returns></returns> public string Save(AuthenticationRefreshToken entity) { return((string)CurrentSession.Save(entity)); }
/// <summary> /// /// </summary> /// <param name="entity"></param> public void Delete(AuthenticationRefreshToken entity) { CurrentSession.Delete(entity); }