/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>  
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ConfirmForgotPasswordResponse response = new ConfirmForgotPasswordResponse();


            return response;
        }
예제 #2
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ConfirmForgotPasswordResponse response = new ConfirmForgotPasswordResponse();


            return(response);
        }
예제 #3
0
        public static async Task ResetPwdForgot(string _username, string _code, int _clientid, string _newPassword)
        {
            using (var cognito = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), Constants.REGION))
            {
                ConfirmForgotPasswordRequest confirmForgotPasswordRequest = new ConfirmForgotPasswordRequest()
                {
                    Username         = _username,
                    ClientId         = Constants.CLIENTAPP_ID,
                    Password         = _newPassword,
                    SecretHash       = CognitoHashCalculator.GetSecretHash(_username, Constants.CLIENTAPP_ID, Constants.NeokySecret),
                    ConfirmationCode = _code
                };

                ConfirmForgotPasswordResponse confirmForgotPasswordResponse = new ConfirmForgotPasswordResponse();

                try
                {
                    confirmForgotPasswordResponse = await cognito.ConfirmForgotPasswordAsync(confirmForgotPasswordRequest).ConfigureAwait(false);

                    ServerSend.ClientForgotPasswordStatus(_clientid, Constants.FORGOT_PASSWORD_CONFIRMED);
                }
                catch (CodeMismatchException)
                {
                    // Username Unknown or Code Expired
                    ServerSend.ClientForgotPasswordStatus(_clientid, Constants.FORGOT_PASSWORD_CODE_MISMATCH_KO);
                }
                catch (ExpiredCodeException)
                {
                    // Username Unknown or Code Expired
                    ServerSend.ClientForgotPasswordStatus(_clientid, Constants.FORGOT_PASSWORD_CODE_EXPIRED_KO);
                }
                catch (Exception e)
                {
                    HandleForgotPwdExceptions(e, _clientid);
                }
            }



            // Initiate Forgot Password Modification By Code

            /*try
             * {
             *  // Lunch myUser Change Forgotten Pwd
             *  //await Server.clients[_clientid].myUser.ConfirmForgotPasswordAsync(_code, _newPassword);
             *  await Server.cognitoManagerServer.provider.
             *  ServerSend.ClientForgotPasswordStatus(_clientid, Constants.FORGOT_PASSWORD_CONFIRMED);
             *
             *  // Authenticate & Check Challenge.
             *
             * }
             * catch (Exception e)
             * {
             *  HandleExceptions(e, _clientid, Constants.SCENE_FORGOT_PASSWORD);
             * }*/
        }