Сбой аутентификации пользователя Cognito - PullRequest
0 голосов
/ 11 октября 2018

У меня возникает проблема, когда я пытаюсь войти в систему с использованием только что созданного имени пользователя.

ответ на запрос аутентификации следующий: "message: Неверное имя пользователя или пароль."

что я делаю не так?

authenticate(username: string, password: string, callback: CognitoCallback) {
        console.log('UserLoginService: starting the authentication');

        const authenticationData = {
            Username: username,
            Password: password,
        };
        const authenticationDetails = new AuthenticationDetails(authenticationData);

        const userData = {
            Username: username,
            Pool: this.cognitoUtil.getUserPool()
        };

        console.log('UserLoginService: Params set...Authenticating the user');
        const cognitoUser = new CognitoUser(userData);
        console.log('UserLoginService: config is ' + AWS.config);
        const that = this;
        cognitoUser.authenticateUser(authenticationDetails, {
            newPasswordRequired: (userAttributes, requiredAttributes) => console.log('change it'),
            onSuccess: result => this.onLoginSuccess(callback, result, username),
            onFailure: err => this.onLoginError(callback, err)
        });
    }

Заранее спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...