Example #1
0
        /// <summary>
        /// Clears any cached authorizations for the specified <paramref name="sessionID"/>.
        /// </summary>
        /// <param name="sessionID">Identifier of session authorization to clear.</param>
        /// <returns><c>true</c> if session authorization was found and cleared; otherwise, <c>false</c>.</returns>
        public static bool ClearAuthorizationCache(Guid sessionID)
        {
            SecurityPrincipal securityPrincipal;
            bool removed = s_authorizationCache.TryRemove(sessionID, out securityPrincipal);

            if (removed)
            {
                SecurityProviderCache.DisableAutoRefresh(securityPrincipal.Identity.Provider);
            }

            return(removed);
        }