magento2
magento2 copied to clipboard
Oauth token request 401 - 'The signature is invalid. Verify and try again.'
Preconditions and environment
On a Magento 2.4.4, I've tried connecting a 3rd party service that's using oauth. It didn't work, so I've tried to check if the endpoint works as expected using Postman. The message 'The signature is invalid. Verify and try again.' is haunting on every try.
Steps to reproduce
- Create a new Integration in System -> Integrations.
- Activate it and move to Postman
- In Postman, create a new POST request to /oauth/token/request/ containing the consumer key and secret, access token and token secret in the Authorization section, making sure that
TypeisOAuth 1.0,Add autorization data tois set toRequest HeadersandSignature methodisHMAC-SHA256.
Expected result
According to the documentation , the response should look like
oauth_token=4cqw0r7vo0s5goyyqnjb72sqj3vxwr0h&oauth_token_secret=rig3x3j5a9z5j6d4ubjwyf9f1l21itrr
Actual result
The response is oauth_problem=The+signature+is+invalid.+Verify+and+try+again., with a 401.
Additional information
No response
Release note
No response
Triage and priority
- [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [X] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @andirosu. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance- upcoming 2.4.x release- For more details, review the Magento Contributor Assistant documentation.
- Add a comment to assign the issue:
@magento I am working on this - To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
@magento give me 2.4-develop instance
Hi @andirosu. Thank you for your request. I'm working on Magento instance for you.
Hi @andirosu, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_473a Login: 6f9552b3 Password: 9482d5bb0383
On the test instance provided, I've created a new Integration and authorized it.
This is the request I've created using using Postman:
POST /oauth/token/request HTTP/1.1 Host: 3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering : application/x-www-form-urlencoded Authorization: OAuth oauth_consumer_key="shmtix5jrk5ltz9eipvhsbhugfpj35vl",oauth_token="xjdpvztdqqweslgzhnpgd7pbnjo6yoti",oauth_signature_method="HMAC-SHA256",oauth_timestamp="1692786897",oauth_nonce="nflVrmmHCsx",oauth_signature="Ff1m0nQZyR8O%2FGQXQLIQBKAO67yzLI1xBcHBnuZK%2FqA%3D" Cookie: PHPSESSID=660dc339cf9b87103203f1f72d3a38f8; private_content_version=43ac6669180b8e42175d66f9426475f3
The response is 401, message is:
oauth_problem=Consumer+key+has+expired
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @okolesnyk. Thank you for your request. I'm working on Magento instance for you.
Hi @okolesnyk, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_2170 Login: 8657b0f8 Password: 32526d758c32
@magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_145e Login: 4d3b64fb Password: 27a2c51ea328
Hi @andirosu,
Thank you for reporting and collaboration.
We are trying to reproduce the issue we are getting response as 400 Bad Request.As per your results you are getting response as 401.Consumer Key is invalid.
We have created a integration and we have given values as follows still we are not getting valid response.Could you please let us know if we are missing anything.
Thanks.
Hi @engcom-Bravo,
Thanks for looking into the issue. In my tests, I've set Add authorization data to to Request Headers and set the Timestamp to {{$timestamp}}.
Even if we don't get the same error message, this still proves there's an issue here, either in the documentation, either code related.
Hi @andirosu,
Thanks for your update.
Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.
Steps to reproduce
- Create a new Integration in System -> Integrations.
- Activate it and move to Postman
- In Postman, create a new POST request to /oauth/token/request/ containing the consumer key and secret, access token and token secret in the Authorization section, making sure that Type is OAuth 1.0, Add autorization data to is set to Request Headers and Signature method is HMAC-SHA256.
As per documentation https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-oauth/#get-a-request-token the result should be oauth_token=4cqw0r7vo0s5goyyqnjb72sqj3vxwr0h&oauth_token_secret=rig3x3j5a9z5j6d4ubjwyf9f1l21itrr
We have created integration and values has been provided still we are getting errors.Hence Confirming the issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-9392 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @engcom-Bravo since past week we facing this issue. kindly update on the issue ---https://github.com/magento/magento2/issues/38019
Thanks for Advance,.
I don't understand, how many stores live when this basic functionality is broken?
I also found a related (but not quite same) ticket https://github.com/magento/magento2/issues/37278#issuecomment-1478635403
Same issue on 2.4.6-p1
I don't understand, how many stores live when this basic functionality is broken?
I also found a related (but not quite same) ticket #37278 (comment)
Me neither..
@magento give me 2.4-develop instance
Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.
Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_ec8f Login: 2c6db121 Password: 323a4ddee0ea
@magento give me 2.4-develop instance
FYI I am seeing this issue when querying a production service and am attempting to reproduce it on a test environment.
Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.
Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_4bb5 Login: b8b7b926 Password: 4420d8365520
@magento give me 2.4-develop instance
Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.
Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_7e96 Login: c844b762 Password: 2a638019f200