magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Oauth token request 401 - 'The signature is invalid. Verify and try again.'

Open andirosu opened this issue 2 years ago • 20 comments

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

  1. Create a new Integration in System -> Integrations.
  2. Activate it and move to Postman
  3. 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.

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”.

andirosu avatar Aug 23 '23 10:08 andirosu

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:


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.

m2-assistant[bot] avatar Aug 23 '23 10:08 m2-assistant[bot]

@magento give me 2.4-develop instance

andirosu avatar Aug 23 '23 10:08 andirosu

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

andirosu avatar Aug 23 '23 10:08 andirosu

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: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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: Confirmed once verification is complete.
  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Aug 23 '23 10:08 m2-assistant[bot]

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

engcom-Bravo avatar Aug 24 '23 12:08 engcom-Bravo

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.

Screenshot 2023-08-24 at 6 54 30 PM

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.

engcom-Bravo avatar Aug 24 '23 13:08 engcom-Bravo

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.

andirosu avatar Aug 25 '23 07:08 andirosu

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.
Screenshot 2023-08-24 at 6 54 30 PM

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.

engcom-Bravo avatar Aug 28 '23 11:08 engcom-Bravo

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-9392 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Aug 28 '23 11:08 github-jira-sync-bot

: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.

m2-assistant[bot] avatar Aug 28 '23 11:08 m2-assistant[bot]

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,.

integrationworktual avatar Sep 30 '23 10:09 integrationworktual

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

onlinebizsoft avatar Oct 04 '23 09:10 onlinebizsoft

Same issue on 2.4.6-p1

kayintveen avatar Oct 26 '23 12:10 kayintveen

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..

jorgb90 avatar Jan 03 '24 11:01 jorgb90

@magento give me 2.4-develop instance

leofdgit avatar Feb 06 '24 16:02 leofdgit

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

leofdgit avatar Feb 07 '24 08:02 leofdgit

FYI I am seeing this issue when querying a production service and am attempting to reproduce it on a test environment.

leofdgit avatar Feb 07 '24 08:02 leofdgit

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

leofdgit avatar Feb 07 '24 13:02 leofdgit

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