public async Task <ISigninModelResponse> SignInUser(ISigninModelUser user) { return(await Task.Run(() => { return new SigninModelResponseMock( "asdfg", "asdfg", "asdfg", "asdfg", 12154587); })); }
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); } }
public async Task <ISigninModelResponse> SignInUser(ISigninModelUser user) { return(await _signin.SignInUser(user)); }
public async Task <ISigninModelResponse> SignInUser(ISigninModelUser user) { AdminInitiateAuthResponse authResponse = await TrySignInUser(user); return(new SigninResponse(authResponse)); }