Rehan Idrisi
Rehan Idrisi

Reputation: 1

OAuth Token from extension response keys are genrrtaing 401 error

I have refered the follwoing link for development.

https://developer.shopware.com/docs/guides/plugins/apps/app-base-guide

I have received api key and api secret from extension installation response but i am aunable to generate the the access token using them, but if i create an acces key manually that key is generating the O Auth is there some step i am missing or settings i might have changed , because this use to work before. But now i am getting the following error.

OAuth Genration Error

Received Client Id and Client Secret using Extension install response.

But these using these credentials i am not able to generate the OAuth token.

Upvotes: 0

Views: 133

Answers (1)

dneustadt
dneustadt

Reputation: 13161

Check the integration table of the Shopware installation. It should have an entry with the access_key you received and label being the technical name of your app. The column secret_access_key contains the encrypted secret.

First make sure that this database record even exists. Then verify that the access_key value equals the one you received.

If all is correct up to that point, test the validity of the secret you received by checking it against the encrypted password stored in the database:

var_dump(password_verify($secretReceived, $encryptedSecretFromDatabase));
// should be "bool(true)"

When you use those credentials for the token request, make sure to use "client_credentials" for the grant_type property.

Upvotes: 0

Related Questions