magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.57k stars 9.32k forks source link

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

Open andirosu opened 1 year ago

andirosu commented 1 year ago

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

m2-assistant[bot] commented 1 year ago

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:

andirosu commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @andirosu. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

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

andirosu commented 1 year ago

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

m2-assistant[bot] commented 1 year ago

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:

magento-deployment-service[bot] commented 1 year ago

Hi @okolesnyk. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

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

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

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

engcom-Bravo commented 1 year ago

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.

andirosu commented 1 year ago

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.

engcom-Bravo commented 1 year ago

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

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.

github-jira-sync-bot commented 1 year ago

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

m2-assistant[bot] commented 1 year ago

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

integrationworktual commented 1 year ago

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

onlinebizsoft commented 1 year ago

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

kayintveen commented 1 year ago

Same issue on 2.4.6-p1

jorgb90 commented 10 months ago

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

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

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

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

leofdgit commented 9 months ago

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

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

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

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

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

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_d72f Login: dd8658ee Password: 42f298f09c83

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_6753 Login: b227bec3 Password: 2f9a8679f483

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_0cf2 Login: b18857aa Password: 1f6f2175f599

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_8a38 Login: 384efafd Password: caedb2ef1f1c

leofdgit commented 9 months ago

Sorry for the spam, I think I just need one more...

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_bfd1 Login: 23f554be Password: b82da4cb1f51

leofdgit commented 9 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 9 months ago

Hi @leofdgit, here is your Magento Instance: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering Admin access: https://3b8bc6a917b54ec489ee9643a8191288.instances-prod.magento-community.engineering/admin_4f97 Login: 0e38694b Password: 995e00f4b64b

leofdgit commented 9 months ago

@magento give me 2.4-develop instance