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; }
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); }
public static Guid login(this TMUser tmUser) { return(tmUser.login(Guid.NewGuid())); }