Beispiel #1
0
        public Guid authenticateUserBaseOn_ActiveDirectory()
        {
            var identity = WindowsIdentity.GetCurrent();

            if (identity != null && identity.IsAuthenticated && identity.ImpersonationLevel == TokenImpersonationLevel.Impersonation)
            {
                var username = identity.Name;
                if (username != null)
                {
                    var tmUser = new TMUser
                            {
                                UserName = username,
                                FirstName = "",
                                LastName = "",
                                GroupID = (int)calculateUserGroupBasedOnWindowsIdentity()
                            };
                    return tmUser.login();
                }
            }
            return Guid.Empty;
        }
Beispiel #2
0
        public Guid authenticateUserBaseOn_ActiveDirectory()
        {
            var identity = WindowsIdentity.GetCurrent();

            if (identity != null && identity.IsAuthenticated && identity.ImpersonationLevel == TokenImpersonationLevel.Impersonation)
            {
                var username = identity.Name;
                if (username != null)
                {
                    var tmUser = new TMUser
                    {
                        UserName  = username,
                        FirstName = "",
                        LastName  = "",
                        GroupID   = (int)calculateUserGroupBasedOnWindowsIdentity()
                    };
                    return(tmUser.login());
                }
            }
            return(Guid.Empty);
        }
Beispiel #3
0
 public static Guid              login(this TMUser tmUser)
 {
     return(tmUser.login(Guid.NewGuid()));
 }