/// <summary> /// Sign In User method. /// </summary> /// <param name="username">Username parameter.</param> /// <param name="isPersistent">Is persistent parameter.</param> private void SignInUser(ISSOUser user, bool isPersistent) { // Initialization. var claims = new List <Claim>(); try { // Setting claims.Add(new Claim(ClaimTypes.Name, user.Name)); claims.Add(new Claim(ClaimTypes.System, user.ExternalId.ToString())); claims.Add(new Claim(ClaimTypes.Email, user.Email)); claims.Add(new Claim(ClaimTypes.NameIdentifier, user.UserName)); var claimIdenties = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie); var ctx = Request.GetOwinContext(); var authenticationManager = ctx.Authentication; // Sign In. authenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent, }, claimIdenties); } catch (Exception ex) { // Info throw ex; } }
public ProjectController(ILogger <ProjectController> logger, IProjectRepository projectRepository, ILogRepository logRepository, ISSOUser sSOUser) { _logger = logger; _projectRepository = projectRepository; _logRepository = logRepository; _ssoUser = sSOUser; }
//rd 就是result data public DataManageController(ILogger <DataManageController> logger, IDataManageRepository dataManageRepository, ISSOUser sSOUser, ILogRepository logRepository) { _logger = logger; _dataManageRepository = dataManageRepository; _ssoUser = sSOUser; _logRepository = logRepository; }
public DataSetController(ILogger <DataSetController> logger, IDataSetRepository dataSetRepository, ILogRepository logRepository, ISSOUser sSOUser) { _logger = logger; _dataSetRepository = dataSetRepository; _logRepository = logRepository; _ssoUser = sSOUser; }
public HomeController(ILogger <HomeController> logger, IProjectRepository projectRepository, IHttpContextAccessor httpContextAccessor, ISSOUser sSOUser) { _logger = logger; _projectRepository = projectRepository; _httpContextAccessor = httpContextAccessor; _ssoUser = sSOUser; }
public LogController(ILogRepository logRepository, ILogger <LogController> logger, ISSOUser sSOUser) { _logRepository = logRepository; _logger = logger; _ssoUser = sSOUser; }
public LogRepository(ILogger<LogRepository> logger, IHttpContextAccessor httpContextAccessor, ISSOUser sSOUser) { _logger = logger; _httpContextAccessor = httpContextAccessor; _ssoUser = sSOUser; }