-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback URL for non web applications #31
Comments
@poyker can you give any update on this? if it is a no that is fine, i will have to use another solution. Thank you |
Here is a code snippet using RestSharp that does the job:
In order for this to work you have to configure the CallBack URL to be your stores Url, in the example it is: https://www.yourstore.com |
thank you @bnoffer that is perfect. I am having trouble with the second request though :( |
Hi @wilbarclay ,
If the issue still persists try uninstalling and reinstalling the API Plugin. That solved an issue for me. I attached my current ApiClient class for further reference. The AuthorizeClient method works just fine on my install now, same goes for the GET method. The Post and Put are currently work in progress. |
Yes the first request works and passes back the GUID code. I will try reinstalling tomorrow, thank you. |
Hi @bnoffer Reinstalling didn't fix it, passes back the code but getting the same error on the token request. I am using nop 3.80 |
I am using 3.80 as well. The error that your screenshot displays normally happens if something went wrong handling the request on the Nop side. I had this happen at the first stage with the OAuth path, wich was not registered properly, which was fixed by the reinstall. Please check your Admin area > System > Warnings and System > Log for more information on the error. |
I am using the code spinet with RestSharp. It is working perfect but is it possible that after sometime inactive I get /oauth/authorize response BadRequest 'Bad Request' ? if I deploy the website, the error is fixed, but then is back. |
In the ClientService class, include support for the ClientCredentials grant type (in the InsertClient() method):
You can then use the method described at the bottom of the Protecting an API using Client Credentials document to access the API:
|
@bnoffer, Any update for nopCommerce 4.0? as I add above code snippiest in 4.0, nopCommerce store stops running. |
Is it possible for the callback URL to be a web page hosted with the nopCommerce website that displays the authorization code?
This is how our application works with the Xero API: https://developer.xero.com/documentation/auth-and-limits/public-applications
Or instead of steps 1,2 and 3
Open Request Authorization Code URL: https://nopsite.com/oauth/authorize?client_id=xxx&client_secret=xxx
The text was updated successfully, but these errors were encountered: