public TenantUserCreateByEmailHandler(IdentityProviderContext context, IIdentityService identityService, IEventPublisher publisher) { this.context = context; this.identityService = identityService; this.publisher = publisher; }
public TenantUserDeleteHandler(IdentityProviderContext context, IEventPublisher publisher, IMapper mapper) { this.context = context; this.publisher = publisher; this.mapper = mapper; }
public async Task <CreateUserResponse> CreateUser(string userIdentifier, string password, string location, string createdBy) { var reply = new CreateUserResponse() { IsSuccessful = false, Result = CreateUserResult.CREATE_OTHER_FAILURE }; using (IdentityProviderContext context = IdentityProviderContext.Create(connectionString)) { try { var user = new User(createdBy, userIdentifier, password); context.Users.Add(user); await context.SaveChangesAsync(); reply.Result = CreateUserResult.CREATE_SUCCESS; reply.IsSuccessful = true; } catch (Exception e) { reply.Result = CreateUserResult.CREATE_DATABASE_FAILURE; reply.IsSuccessful = false; } } return(reply); }
public CreateTenantHandler(IdentityProviderContext context, IMapper mapper, IEventPublisher publisher) { this.context = context; this.mapper = mapper; this.publisher = publisher; }
public TenantUserEditHandler(IdentityProviderContext context, IIdentityService identityService, IEventPublisher publisher, IMapper mapper) { this.context = context; this.identityService = identityService; this.publisher = publisher; this.mapper = mapper; }
public UserDeleteHandler( IdentityProviderContext context, IIdentityService identityService, IEventPublisher eventPublisher) { this.context = context; this.identityService = identityService; this.eventPublisher = eventPublisher; }
public UserEditHandler( IdentityProviderContext context, IIdentityService identityService, IMapper mapper) { this.context = context; this.identityService = identityService; this.mapper = mapper; }
public async Task <ICollection <GroupInfo> > GetAllGroups() { List <GroupInfo> ret = new List <GroupInfo>(); using (IdentityProviderContext context = IdentityProviderContext.Create(connectionString)) { await Task.Run(() => context.Groups.Where(g => g.ParentGroup == null).ToList().ForEach(delegate(Group g) { ret.AddRange(GetGroups(g)); })); } return(ret); }
public async Task <ICollection <GroupInfo> > GetUserGroups(string userIdentifier) { List <GroupInfo> ret = new List <GroupInfo>(); using (IdentityProviderContext context = IdentityProviderContext.Create(connectionString)) { if (!context.Users.Any(u => u.UserIdentifier == userIdentifier)) { return(new List <GroupInfo>()); } (context.Users.Include("Groups").Include("Groups.Group").Single(u => u.UserIdentifier == userIdentifier).Groups.ToList().Select(ug => ug.Group).ToList()) .ForEach(delegate(Group g) { Group tmpGrp = g; GroupInfo tmpGi = null; GroupInfo childGi = null; while (tmpGrp != null) { if (tmpGi != null) { childGi = tmpGi; } tmpGi = ret.Any(gi => gi.GroupIdentifier == tmpGrp.GroupIdentifier) ? ret.First(gi => gi.GroupIdentifier == tmpGrp.GroupIdentifier) : new GroupInfo { GroupIdentifier = tmpGrp.GroupIdentifier, ParentGroup = null }; if (childGi != null) { childGi.ParentGroup = tmpGi; } if (!ret.Any(gi => gi.GroupIdentifier == tmpGi.GroupIdentifier)) { ret.Add(tmpGi); } if (tmpGrp.ParentGroupId != null) { tmpGrp = context.Groups.Single(grp => grp.GroupId == tmpGrp.ParentGroupId); } else { tmpGrp = null; } } }); } return(ret); }
public async Task <LoginInformation> GetUserLogin(string userIdentifier, string password, string location) { LoginInformation ret = new LoginInformation() { IsValid = false, LoginResult = LoginResult.LOGIN_PROVIDER_FAILURE }; try { using (IdentityProviderContext context = IdentityProviderContext.Create(connectionString)) { User user = await Task.Run(() => context.Users.FirstOrDefault(u => u.UserIdentifier == userIdentifier)); if (user != null) { ret = VerifyLogin(user, password, location); try { LoginAttempt la = new LoginAttempt() { LoginLocation = location, Result = ret.LoginResult, UserId = user.UserId }; context.LoginAttempts.Add(la); context.SaveChanges(); } catch (Exception e) { ret.IsException = true; ret.ExceptionInformation = e.ToString(); ret.LoginResult = LoginResult.LOGIN_DATABASE_FAILURE; ret.IsValid = false; } } else { ret.LoginResult = LoginResult.LOGIN_AUTHENTICATION_FAILURE; } } } catch (Exception e) { ret.IsException = true; ret.ExceptionInformation = e.ToString(); ret.LoginResult = LoginResult.LOGIN_OTHER_FAILURE; } return(ret); }
public TenantListHandler(IdentityProviderContext context, IConfigurationProvider configurationProvider) : base(context, configurationProvider) { }
public TenantDropdownHandler(IdentityProviderContext context) { this.context = context; }
public TenantUserListHandler(IdentityProviderContext context) : base(context) { }
public DeleteTenantHandler(IdentityProviderContext context, IEventPublisher publisher) { this.context = context; this.publisher = publisher; }
public UserGetHandler(IdentityProviderContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public RegisterModel(UserManager <User> userManager, IdentityProviderContext context) { this.userManager = userManager; this.context = context; }
public ProfileService(UserManager <User> userManager, IdentityProviderContext dbContext) { this.userManager = userManager; this.dbContext = dbContext; }
public UserSearchHandler(IdentityProviderContext context, IConfigurationProvider configurationProvider) { this.context = context; this.configurationProvider = configurationProvider; }
public TenantUserCreateOrUpdateByIdHandler(IdentityProviderContext context, IEventPublisher publisher) { this.context = context; this.publisher = publisher; }