Skip to content

[Issue] Fixed customertoken not generating after configured failure in a row #34067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 3 tasks
m2-assistant bot opened this issue Sep 13, 2021 · 3 comments · Fixed by #34001
Closed
1 of 3 tasks

[Issue] Fixed customertoken not generating after configured failure in a row #34067

m2-assistant bot opened this issue Sep 13, 2021 · 3 comments · Fixed by #34001
Assignees
Labels
Area: APIs Component: Integration Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S1 Affects critical data or functionality and forces users to employ a workaround.

Comments

@m2-assistant
Copy link

m2-assistant bot commented Sep 13, 2021

This issue is automatically created based on existing pull request: #34001: Fixed customertoken not generating after configured failure in a row


Description (*)

This pull request solves the issue when a customer has tried too many fail attempt (i.e more no of times than in the configuration)for generating the customer token via graphql or rest api. Then the customer is not able to log into the system ever.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Make more number of unsuccessful attempt than the configured number of times (configuration can be found in Services->Oauth) to generate the customer token via generateCustomerToken graphql api.
  2. After that, the customer would not be able to generate the token even with correct credentials.

Questions or comments

The issue was occuring because in the current system, there was no any check if lock_expires_at in oauth_token_request_log is greater than current date time. So, the system always returns the no of failed attempts.

For example, let's say, if the configured no of failed attempt is 6. And the customer has tried 7 times to generate the customer token via graphql api. Now, after the expiry time of lock_expires_at even when he/she tries with correct credentials, he/she is not able to generate the customer token and get the exception

'The account sign-in was incorrect or your account is disabled temporarily. '
. 'Please wait and try again later.'
image

This is a major issue for the Scandi PWA login as customer is not able to logged into the PWA after trying too many unsuccessful attempt.

To resolve the issue, i have applied the check if lock_expires_at is greater than current date time. Then we got zero token in that case and when the customer login with correct credentials, he/she will log into the system.

Please let me know if you need additional test cases (i have to make the test cases, lol) or any other description you want.

Contribution checklist (*)

  • [ *] Pull request has a meaningful description of its purpose
  • [ *] All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
@m2-assistant m2-assistant bot added Component: Integration Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. labels Sep 13, 2021
@engcom-Alfa engcom-Alfa added Area: APIs Reported on 2.4.2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Sep 13, 2021
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-1212 is successfully created for this GitHub issue.

@m2-assistant
Copy link
Author

m2-assistant bot commented Sep 13, 2021

✅ Confirmed by @engcom-Alfa. Thank you for verifying the issue.
Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@sidolov sidolov added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Sep 23, 2021
@sidolov
Copy link
Contributor

sidolov commented Sep 23, 2021

Hi @m2-assistant[bot]. Thank you for your report.
The issue has been fixed in #34001 by @sagar2009kumar in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.3 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: APIs Component: Integration Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
Status: Pull Request In Progress
Development

Successfully merging a pull request may close this issue.

4 participants