protected override void Init(IApplicationUser user, int?clientId) { base.Init(user, clientId); this.created = Dom.DateTimeOffsetDom.Now; this.createdBy = user.UserName; this.SetEdited(user); }
public static Category Create(IApplicationUser user, int clientId) { var result = new Category(); result.Init(user, clientId); return(result); }
public QuestionController(IQuestion questionImplementation, ICategory categoryImplementation, IApplicationUser applicationUserImplementation, UserManager <ApplicationUser> userManager) { _questionImplementation = questionImplementation; _categoryImplementation = categoryImplementation; _applicationUserImplementation = applicationUserImplementation; _userManager = userManager; }
public PostController(IPost post, IForum forum, UserManager <ApplicationUser> userManager, IApplicationUser user) { _post = post; _forum = forum; _userManager = userManager; _user = user; }
public static ClientSettings Create(IApplicationUser user, int clientId) { var result = new ClientSettings(); result.Init(user, clientId); return(result); }
public void Update(IApplicationUser user, IUpdateParam dto) { this.name = dto.name; accessStart = dto.accessStart; accessEnd = dto.accessEnd; SetEdited(user); }
public static Client Create(IApplicationUser user) { var result = new Client(); result.Init(user); return(result); }
public ReplyController(IPost postService, UserManager <ApplicationUser> userManager, IApplicationUser userService) { this.postService = postService; this.userManager = userManager; this.userService = userService; }
public static SystemSettings Create(IApplicationUser user) { var result = new SystemSettings(); result.Init(user); return(result); }
/// <summary> /// Encrypts the JWT security token asynchronous. /// </summary> /// <param name="appUser">The application user.</param> /// <returns> /// JWT Packet /// </returns> private async Task <string> GetJwtSecurityTokenAsync(IApplicationUser appUser) { return(await Task.Factory.StartNew(() => { var signingKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(this.SeceretKey)); var signingCredentials = new SigningCredentials(signingKey, SecurityAlgorithms.HmacSha256Signature, SecurityAlgorithms.Sha256Digest); var claims = new Claim[] { new Claim(JwtRegisteredClaimNames.Sid, appUser.UserId.ToString()), new Claim(JwtRegisteredClaimNames.Email, appUser.UserName) //new Claim(ClaimTypes.UserData, EncryptObject(appUser)) }; var tokenDescriptor = new SecurityTokenDescriptor { Subject = new ClaimsIdentity(claims), SigningCredentials = signingCredentials, Issuer = _configuration.GetAppSettingValue(AppSettings.JwtIssuer), Audience = _configuration.GetAppSettingValue(AppSettings.JwtAudience), Expires = DateTime.UtcNow.AddMinutes(30) }; var jwtTokenHandler = new JwtSecurityTokenHandler(); if (jwtTokenHandler.CanWriteToken) { var token = jwtTokenHandler.CreateToken(tokenDescriptor); return jwtTokenHandler.WriteToken(token); } return string.Empty; })); }
public static UserGroup Create(IApplicationUser user, int clientId) { var result = new UserGroup(); result.Init(user, clientId); return(result); }
public PostController(IPost postRepositories, IForum forumRepositories, UserManager <ApplicationUser> userManager, IApplicationUser applicationUserRepositories) { _postRepositories = postRepositories; _forumRepositories = forumRepositories; _userManager = userManager; _applicationUserRepositories = applicationUserRepositories; }
public ReplyController(IForum forumService, IPost postService, IApplicationUser userService, UserManager <ApplicationUser> userManager) { _forumService = forumService; _postService = postService; _userService = userService; _userManager = userManager; }
public ReplyController(IMail mailService, UserManager <ApplicationUser> userManager, IApplicationUser userService, IPlatform platformService) { _mailService = mailService; _userManager = userManager; _userService = userService; _platformService = platformService; }
public HomeController(IPost postService, IApplicationUser userService, ApplicationDbContext db, ITeam teamService) { _postService = postService; _userService = userService; _db = db; _teamService = teamService; }
public async Task <IActionResult> DeleteUser(string id) { if (!(await authorizationService.AuthorizeAsync(User, id, AccountManagementOperations.Delete)).Succeeded) { return(new ChallengeResult()); } if (!await accountManager.TestCanDeleteUserAsync(id)) { return(BadRequest("User cannot be deleted. Delete all orders associated with this user and try again")); } UserViewModel userViewModel = null; IApplicationUser applicationUser = await accountManager.GetUserByIdAsync(id); if (applicationUser != null) { userViewModel = await FetchUserViewModel(applicationUser.Id); } if (userViewModel == null) { return(NotFound(id)); } var result = await accountManager.DeleteUserAsync(applicationUser); if (!result.Item1) { throw new Exception("The following errors occurred whilst deleting user: "******", ", result.Item2)); } return(Ok(userViewModel)); }
public ProfileController(UserManager <ApplicationUser> userManager, IApplicationUser userService, IUpload uploadService, IHostingEnvironment he) { this.userManager = userManager; this.userService = userService; this.uploadService = uploadService; this._hosting = he; }
public ProfileController(IApplicationUser profileImplementation, IApplicationUser userImplementation, UserManager <ApplicationUser> profileManager, ApplicationDbContext context) { _profileImplementation = profileImplementation; _profileManager = profileManager; _userImplementation = userImplementation; _context = context; }
public ProfileController(UserManager <ApplicationUser> userManager, IApplicationUser userService, IUpload uploadService, IConfiguration configuration) { _userManager = userManager; _userService = userService; _uploadService = uploadService; _configuration = configuration; }
public PostController(IPost postService, IForum forumService, UserManager <ApplicationUser> userManager, IApplicationUser userService) { _postService = postService; _forumService = forumService; _userManager = userManager; _userService = userService; }
public AnswerController(IQuestion questionImplementation, IAnswer answerImplementation, UserManager <ApplicationUser> userManager, IApplicationUser applicationUserImplementation) { _questionImplementation = questionImplementation; _answerImplementation = answerImplementation; _userManager = userManager; _applicationUserImplementation = applicationUserImplementation; }
public void Update(IApplicationUser user, IApplicationUserUpdateParam param) { this.displayName = param.displayName; this.Email = param.email; this.accessStart = param.accessStart; this.accessEnd = param.accessEnd; }
public PostController(IThreadEntity threadEntityService, IApplicationUser appUserService, UserManager <ApplicationUser> userManager) { _threadEntityService = threadEntityService; _appUserService = appUserService; _userManager = userManager; }
public async Task <string> GetTokenAsync(IApplicationUser applicationUser, string jwtSecretKey) { ApplicationUser user = applicationUser as ApplicationUser; var tokenHandler = new JwtSecurityTokenHandler(); var key = Encoding.ASCII.GetBytes(jwtSecretKey); //var user = await _userManager.FindByEmailAsync(applicationUser.Email); var roles = await _userManager.GetRolesAsync(user); var claims = new List <Claim> { new Claim(ClaimTypes.Email, applicationUser.Email), new Claim(ClaimTypes.NameIdentifier, user.Id) }; foreach (var role in roles) { claims.Add(new Claim(ClaimTypes.Role, role)); } var tokenDescriptor = new SecurityTokenDescriptor { Subject = new ClaimsIdentity(claims.ToArray()), Expires = DateTime.UtcNow.AddMonths(2), SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) }; var token = tokenHandler.CreateToken(tokenDescriptor); return(tokenHandler.WriteToken(token)); }
public async Task <IIdentityResult> CreateAsync(IApplicationUser user) { ApplicationUser realUser = new ApplicationUser() { Id = user.Id, TemporaryToken = user.TemporaryToken, AccessFailedCount = user.AccessFailedCount, ConcurrencyStamp = user.ConcurrencyStamp, Email = user.Email, EmailConfirmed = user.EmailConfirmed, LockoutEnabled = user.LockoutEnabled, LockoutEnd = user.LockoutEnd, NormalizedEmail = user.NormalizedEmail, NormalizedUserName = user.NormalizedUserName, PasswordHash = user.PasswordHash, PhoneNumber = user.PhoneNumber, PhoneNumberConfirmed = user.PhoneNumberConfirmed, RequiresPasswordCreation = user.RequiresPasswordCreation, SecurityStamp = user.SecurityStamp, TwoFactorEnabled = user.TwoFactorEnabled, UserName = user.UserName }; var result = await _userManager.CreateAsync(realUser); return(ConvertToInterface(result)); }
public ManageController(IApplicationUser applicationuser, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager) { _applicationUser = applicationuser; _userManager = userManager; _signInManager = signInManager; }
public AdminPanelController(ApplicationDbContext context, ICategory categoryImplementation, IApplicationUser applicationUserImplementation, IQuestion questionImplementation) { _categoryImplementation = categoryImplementation; _applicationUserImplementation = applicationUserImplementation; _questionImplementation = questionImplementation; _context = context; }
public PostController(IPost postService, IForum forumService, IApplicationUser userService, UserManager <ApplicationUser> manager) { this.postService = postService; this.forumService = forumService; this.userService = userService; userManager = manager; }
public ForumController(IForum forumService, IConfiguration configuration, IApplicationUser userService, IUpload uploadService) { _forumService = forumService; _configuration = configuration; _userService = userService; _uploadService = uploadService; }
public async Task <IApplicationUser> UpdateUser(IApplicationUser user) { var identityUser = user as ApplicationUser; await _userManager.UpdateAsync(identityUser); return(user); }
public async Task<IApplicationUser> UpdateEmailOrUsernameAsync(IApplicationUser user, string password) { try { return await Repository.UpdateUserEmailOrUsernameAsync(user, password); } catch (Exception ex) { throw ex; } }
public async Task<bool> RegisterUser(IApplicationUser user, string password) { try { return await Repository.RegisterUser(user, password); } catch (Exception ex) { throw ex; } }
public async Task<int> UpdateAsync(IApplicationUser user) { try { return await Repository.UpdateAsync<ApplicationUserEntity>(AutoMapper.Mapper.Map<ApplicationUserEntity>(user)); } catch (Exception ex) { throw ex; } }
public async Task<bool> RegisterUser(IApplicationUser user, string password) { try { //Error: http://prntscr.com/9q0cf0 IdentityResult result = await UserManager.CreateAsync(AutoMapper.Mapper.Map<ApplicationUserEntity>(user), password); return result.Succeeded; //return result.Succeeded; } catch (Exception ex) { throw ex; } }
public virtual Task<int> AddAsync(IApplicationUser user) { return Repository.AddAsync<ApplicationUser>(Mapper.Map<ApplicationUser>(user)); }
public Task<int> AddAsync(IApplicationUser user) { return Repository.AddAsync(user); }
public Task<bool> RegisterUser(IApplicationUser user, string password) { return Repository.RegisterUser(user, password); }
public GetAllNonDeletedUsersQuery(IDatabaseProvider connection, IApplicationUser user) { _connection = connection; _user = user; }
public virtual async Task<bool> RegisterUser(IApplicationUser user, string password) { IdentityResult result = await UserManager.CreateAsync(Mapper.Map<ApplicationUser>(user), password); return result.Succeeded; }
public ApplicationUserTier(IApplicationUser repository) { this.repository =repository; }
public GetOrganizationsQuery(IDatabaseProvider connection, IApplicationUser user) { _connection = connection; _user = user; }
public virtual Task<int> AddAsync(IApplicationUser user) { try { return Repository.AddAsync<ApplicationUser>(Mapper.Map<ApplicationUser>(user)); } catch (Exception e) { throw e; } }
public GetRolesLimitedByCurrentUserQuery(IDatabaseProvider connection, IApplicationUser user) { _connection = connection; _user = user; }