Exemplo n.º 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));
        }
Exemplo n.º 2
0
 public void Update(PartialAccountSalt partialAccountSalt)
 {
     _saltRepository.Update(partialAccountSalt);
 }
Exemplo n.º 3
0
 public void Delete(PartialAccountSalt partialAccountSalt)
 {
     _saltRepository.Delete(partialAccountSalt);
 }
Exemplo n.º 4
0
 public void Create(PartialAccountSalt partialAccountSalt)
 {
     _saltRepository.Insert(partialAccountSalt);
 }