Exemplo n.º 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());
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public async Task <bool> VerifyTicketAsync(string subject, string sessionToken, bool renew = true)
 {
     return(await SessionCacheStore.VerifySessionAsync(subject, sessionToken, renew).ConfigureAwait(false));
 }
Exemplo n.º 4
0
 public async Task RemoveAsync(string key)
 {
     await SessionCacheStore.DeleteSessionAsync(key).ConfigureAwait(false);
 }
Exemplo n.º 5
0
        public async Task <string> GetSessionTokenAsync(string subject)
        {
            var session = await SessionCacheStore.GetSessionBySubjectAsync(subject).ConfigureAwait(false);

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