Esempio n. 1
0
 public async Task <ISigninModelResponse> SignInUser(ISigninModelUser user)
 {
     return(await Task.Run(() => {
         return new SigninModelResponseMock(
             "asdfg",
             "asdfg",
             "asdfg",
             "asdfg",
             12154587);
     }));
 }
Esempio n. 2
0
        private async Task <AdminInitiateAuthResponse> TrySignInUser(ISigninModelUser user)
        {
            try
            {
                AdminInitiateAuthRequest authRequest = GetAuthRequest(user.Username, user.Password);

                AmazonCognitoIdentityProviderClient identityProviderClient = GetAmazonCognitoIdentity();

                return(await identityProviderClient.AdminInitiateAuthAsync(authRequest));
            }
            catch (NotAuthorizedException e)
            {
                throw new WebApiException(System.Net.HttpStatusCode.Unauthorized, e.Message);
            }
            catch (UserNotConfirmedException e)
            {
                throw new WebApiException(System.Net.HttpStatusCode.Forbidden, e.Message);
            }
            catch (Exception e)
            {
                throw new WebApiException(System.Net.HttpStatusCode.InternalServerError, e.Message);
            }
        }
Esempio n. 3
0
 public async Task <ISigninModelResponse> SignInUser(ISigninModelUser user)
 {
     return(await _signin.SignInUser(user));
 }
Esempio n. 4
0
        public async Task <ISigninModelResponse> SignInUser(ISigninModelUser user)
        {
            AdminInitiateAuthResponse authResponse = await TrySignInUser(user);

            return(new SigninResponse(authResponse));
        }