magento2: Magento 2 - OAuth Problem = Consumer Key Has Expired
Preconditions
- Magento Version 2.4
- Set up and activated API Integration with full access
Steps to reproduce
- Create integrations
- Make POST call to
/oauth/token/request
Expected result
- Get request token
Actual result
- oauth_problem=Consumer+key+has+expired

I tried it with two different integrations, both are activated, and both return the same response of “consumer key has expired”
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 59 (25 by maintainers)
Nope. Stopped using Magento.
@lenaorobei @ihor-sviziev so basically this feature is a little bit buggy, currently testing on 2.3.2 (current live site) and 2.3.5 Here is my step by step:
So… basically I cannot replicate the issue today, even though yesterday it was clear 😦 In my humble opinion the documentation needs to be updated how
oauth_signatureis calculated in order to be able to use applications like PostMan (or any other soapUI) so you can prepareoauth_signaturerequired for authentication.From looks of it, yesterday (and reported problem on github) comes from not clear instructions in dev docs. Here is what I’ve done a day ago:
So here is (I belive so) the REAL issue with this:
CallBack URLandIdentity link URLemptyaccess tokenandaccess token secret)after you “Authorize” it in backend, field updated_at in database remains empty
and that is causing issues with key validation
consumer key has expiredI think Magento should not authorize an application without endpoints and without checks for callback, or a “self-authorization” needs to be fixed on code level to specify “updated_at” with right value.
There is a second issue with this, but it is also related to wrong date calculations. I will get to it with more details once I double check.
Hello @ihor-sviziev
It seems @KiuNguyen closed this issue by mistake. I have reopened internal Jira ticket and link with this issue again
@sdzhepa: Mistakes happen, to everyone…
Although this shows an issue in the process. What actions you guys at CORE are planning to take to mitigate this? Such flow should not happen in the first place and it looks like it can happen in future for any other tickets (yes also to VALID tickets and issues)…
Hi @lylesback2, According to https://github.com/magento/magento2/issues/13961#issuecomment-658230648 the issue was already solved by updating the docs: https://devdocs.magento.com/guides/v2.3/get-started/authentication/gs-authentication.html#web-api-clients-and-authentication-methods
@qsolutions-pl @PiotrSiejczuk Thank you for reporting. We will triage this issue with product organization and prioritize. Hopefully you are able to use OAuth-based authentication following DevDocs with non-empty
Callback URLandIdentity linkvalues.I can confirm, we contributors can not close any issues or PRs anymore so we have to ping someone from the maintainer teams.
I’m encountering the issues described in this Bug Report, but problem seems to be a little bit more complex:
When I’m calling simple endpoints, everything works more-less correct:
However, the same keys used to fetch the Invoices ends up with “The signature is invalid”
But it works completely fine if you don’t use SearchCriteria:
Looks like there’s some mess around calculating request signature 👎🏻
The issue appears when the URL is urlencoded:

Hi @ringwood-dsg,
According to https://github.com/magento/magento2/issues/13961#issuecomment-658230648 the issue was already solved by updating the docs: https://devdocs.magento.com/guides/v2.3/get-started/authentication/gs-authentication.html#web-api-clients-and-authentication-methods
I’m currently debugging this on my end, 2.3.5 version, will send an update once I finish
@sdzhepa this looks really important issue, there was discussion in
#appdesignchannel in Slack https://magentocommeng.slack.com/archives/CBSL1DF8B/p1588761675119500. Could you confirm this issue and set the correct prio / severity?Hi,
Anyone Help me to suggest REST API Authentication using oauth 1
I am using OAuth based authentication,
But Its Showing
{“message”:”Consumer is not authorized to access %resources”,”parameters”:{“resources”:”Magento_Customer::customer”}
I am getting above errror, Please try to resolve it
Please resolve it I am using Magento 2.2.3 version, using below code to authenticate it
I found the source of my issue. Upon creating the integration and activating it, I get a consumer key, consumer secret, access token, and access token secret. So, technically, I can just skip the “Get Access Token” step of the authentication. I was able to successfully make API calls with the provided access token.
If I created the integration with an Identity link URL, then the access token and access token secret is not supplied. And when I made a request to /oauth/token/request, I got the access token and secret as a response.
If this was the intended process, then my apologies for misinterpreting the documentation.