public bool RemoveTicketValue(ref GrantData tokenValue) { if (TicketStore.Remove(tokenValue.Token, out tokenValue)) { return(true); } tokenValue = new GrantData(); return(false); }
private bool IsOneToken(GrantData grantData, GrantData grantDataN) { if (grantData.ClientID == grantDataN.ClientID && grantData.UserID == grantDataN.UserID && grantData.TokenType == grantDataN.TokenType) { return(true); } return(false); }
public bool RemoveOldTicket(GrantData grantData) { foreach (var val in this.GetAll()) { if (IsOneToken(grantData, val)) { return(TicketStore.Remove(val.Token)); } } return(false); }
public bool GetToken(GrantData grantData) { foreach (var val in this.GetAll()) { if (IsOneToken(grantData, val)) { grantData.Token = val.Token; return(true); } } return(false); }
public bool SetTicketValue(GrantData tokenValue) { TicketStore.Set(tokenValue.Token, tokenValue, (tokenValue.ExpiresUtc - tokenValue.IssuedUtc).Minutes); return(true); }