Ejemplo n.º 1
0
 public static bool Check(this DBSessionToken session, SiteInfo siteInfo)
 {
     return(true);
     // TODO: add checks when clients use the sign in and refresh flows defined by IAM and not the old auth APIs
     // return session.CheckSiteInfo(siteInfo)
     //     && session.CheckExpirationDate();
 }
Ejemplo n.º 2
0
        public static bool CheckExpirationDate(this DBSessionToken session)
        {
            var date       = session.LastRefreshed ?? session.Issued;
            var validUntil = date + SessionTokenRepository.TOKEN_EXPIRATION;
            var now        = DateTime.UtcNow;

            return(validUntil >= now);
        }
Ejemplo n.º 3
0
 public static bool CheckSiteInfo(this DBSessionToken session, SiteInfo siteInfo)
 {
     return(session.UserAgent == siteInfo.UserAgent);
 }