magento-lts
magento-lts copied to clipboard
Fixed incorrect OAuth nonce_used error when it should be error on inc…
…orrect consumer key.
Description (*)
Incorrect error message leads the developer astray and can waste hours on the wrong thing. This PR fixes such a bug.
Manual testing scenarios (*)
I use openmage-shooter to test.
- [OpenMage OAuth Server] Add a consumer if none exist.
- [DDEV] Install openmage-shooter in your DDEV environment.
- [Browser] Open https://openmage.ddev.site/shooter/rest
- Fill in the OAuth params, on Consumer Key, enter a wrong key.
- Click save.
- Error nonce_used:
- Try again with this PR, error: Could not retrieve a valid Token response from Token URL: oauth_problem=consumer_key_rejected
Tried and failed ...
- install your module
- added oauth consumer
- went to "shooter/rest"
- got redirected to customer login
- logged in
- "shooter/rest/index" shows 404
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Tried and failed ...
- install your module
- added oauth consumer
- went to "shooter/rest"
- got redirected to customer login
- logged in
- "shooter/rest/index" shows 404
Did you add your OAuth consumer in the same OpenMage instance? Test the API to itself? I do not think this can work. I used the session to store OAuth token, if you login in to authorize, the session is lost Can you test the API with another OpenMage instance?
After installing openmage-shooter, the normal steps in the browser are:
- Login to frontend, your customer ID must be <20 to access
shooter - Access "shooter/rest"
- Input URL other than local
- Redirected to server for authorization with email/password
- Redirect back to "shooter"
- Start the API test
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code