Пример #1
0
        public async Task <AuthenticationTicket> RetrieveAsync(string key)
        {
            var session = await SessionCacheStore.GetSessionAsync(key).ConfigureAwait(false);

            if (session == null)
            {
                return(null);
            }
            return(session.ConvertToTicket());
        }
Пример #2
0
        public async Task RenewAsync(string key, AuthenticationTicket ticket)
        {
            var session = AuthSession.FromAuthenticationTicket(ticket);

            if (session == null)
            {
                await Task.CompletedTask.ConfigureAwait(false);
            }
            session.SessionId = key;
            await SessionCacheStore.StoreSessionAsync(session).ConfigureAwait(false);
        }
Пример #3
0
 public async Task <bool> VerifyTicketAsync(string subject, string sessionToken, bool renew = true)
 {
     return(await SessionCacheStore.VerifySessionAsync(subject, sessionToken, renew).ConfigureAwait(false));
 }
Пример #4
0
 public async Task RemoveAsync(string key)
 {
     await SessionCacheStore.DeleteSessionAsync(key).ConfigureAwait(false);
 }
Пример #5
0
        public async Task <string> GetSessionTokenAsync(string subject)
        {
            var session = await SessionCacheStore.GetSessionBySubjectAsync(subject).ConfigureAwait(false);

            return(session?.SessionToken ?? string.Empty);
        }