예제 #1
0
        /// <summary>
        /// Business logic for registering accounts from Single Sign On.
        /// </summary>
        /// <param name="registrationDto"></param>
        /// <returns></returns>
        public HttpResponseMessage RegisterPartialAccount(SsoRegistrationRequestDTO registrationDto)
        {
            // Validation Step
            if (_partialAccountLogic.Exists(registrationDto.Username) ||
                _accountLogic.Exists(registrationDto.Username))
            {
                return(new HttpResponseMessage(HttpStatusCode.Conflict));
            }

            // Add new PartialAccount to the database
            var partialAccount = new PartialAccount()
            {
                UserName    = registrationDto.Username,
                Password    = registrationDto.HashedPassword,
                AccountType = registrationDto.RoleType
            };

            // Add new attached Salt to the database connected with PartialAccount.
            var salt = new PartialAccountSalt()
            {
                PasswordSalt   = registrationDto.PasswordSalt,
                UserName       = registrationDto.Username,
                PartialAccount = partialAccount
            };

            _partialAccountSaltLogic.Create(salt);

            return(new HttpResponseMessage(HttpStatusCode.OK));
        }
예제 #2
0
 public void Update(PartialAccountSalt partialAccountSalt)
 {
     _saltRepository.Update(partialAccountSalt);
 }
예제 #3
0
 public void Delete(PartialAccountSalt partialAccountSalt)
 {
     _saltRepository.Delete(partialAccountSalt);
 }
예제 #4
0
 public void Create(PartialAccountSalt partialAccountSalt)
 {
     _saltRepository.Insert(partialAccountSalt);
 }