question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Reset Password is not working

See original GitHub issue

Summary

When using “Reset Password” the app returns the error “Your access-token is invalid and could not be used to identify the API client.”. This happens regardless if the email is known to the system or not.

screenshot 2022-01-28 um 11 10 16

Steps To Reproduce

Expected result

  • no error message

Actual result

  • error message “Your access-token is invalid and could not be used to identify the API client.”

System Information (as applicable)

Browser: Chrome Version 97.0.4692.99 Node version: pwa-kit version: 1.3 Desktop OS: Mobile Device Info:

Happens on the official test system, on our test system and locally.

Additional information

I tried to trace down this to myself but was not successful.

It seems that the underlying call

https://{{short_code}}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{{organization_id}}/customers/password/actions/create-reset-token?siteId={{site_id}}

is executed with the SLAS token and this does not work. I can reproduce the same error in Postman.

The documentation actually says to use the AM based token (https://account.demandware.com/dwsso/oauth2/access_token). But this did also not work for me and returns

“Your access-token is valid, but you have no permissions to access the resource.”.

The related OCAPI permission is set but there is no related AuthZ Scope that could be set.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
johnboxallcommented, Jan 28, 2022

To offer an alternative, you can also bridge the current API gap using OCAPI hooks.

https://github.com/SalesforceCommerceCloud/ocapi_hooks_collection shows how to do this.

  1. It extends the dw.ocapi.shop.customers.password_reset.afterPOST to send a password reset email.
  2. It extends dw.ocapi.shop.auth.beforePOST to accept the reset token and attempt to set the users password.

You can review the tests for the basic flow:

https://github.com/SalesforceCommerceCloud/ocapi_hooks_collection/blob/main/test/integration/ocapi/04_passwordReset.js

I’m going to leave this issue open until we’ve resolved it in the default generated PWA.

0reactions
echessmancommented, Nov 30, 2022

Hello @stm-dschulz Thank you for the feedback. We will be looking into this in the first half of 2023.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Password Reset using Active Directory Users & Computers fails
Provides a solution to an error that occurs when you reset the password of a user.
Read more >
The Password Is Incorrect After Update in Windows 10 FIX
The error "The password is incorrect. Try again" may appear after a Windows 10 update. The strange thing about this problem is that...
Read more >
Password Reset Page Doesn't Work - Blizzard Support
If the self-service password reset website doesn't work, clear the cache and cookies in your browser or try a different browser. If you...
Read more >
Password reset issues | Apigee Edge
The user should check their mailbox and follow the instructions given in the email to reset the password. Sometimes it is found that...
Read more >
Password reset functionality is not working getting error "Sub ...
To replace the invalid reference and fix the issue follow the below steps. Connect to the Sub Domain from Domain Picker. Navigate to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found