-
Notifications
You must be signed in to change notification settings - Fork 213
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
Support for nopcommerce 4.30 #223
Comments
thanks |
Added 4.3 support in this fork https://github.com/madewithfire/api-plugin-for-nopcommerce |
thank you,very much |
@madewithfire Thank you for your contribution! It is much appreciated! Let the community test it a little bit and if the feedback is positive we will merge it. |
Thanks @poyker , I will come up with more updates once I get some time. |
@poyker @madewithfire any update on the 4.3 version. I am excited for 4.3 |
@madewithfire Reviewing your code now and you've done a fantastic job at cleaning up the API and saved me a tremendous amount of time. Thank you! For anyone interested it looks like this implementation is now based on tokens generated from UserIds(users/customers) in Nop where they have the Role 'Api' assigned; on first review seems sensible. It looks like the Some points for others who have a vested interest in this project.
I believe you need to replace:
with
should be
I am currently working on getting my fork of this API (which has additional controllers) working and merged with @madewithfire code and properly testing everything. Perhaps we could commit all of it together at some point? |
I have completed a very rudimentary untested version which supports 4.3 resolves the issues with @madewithfire code but merges the good parts plus my additions which include PictureService and TaxCategoriesService. For anyone interested the code is here https://github.com/MaximG1234/api-plugin-for-nopcommerce. I feel this plugin is critical to the ongoing development of the NopCommerce platform and I would really love to discuss with other interested parties about maintaining this project move actively going forward along with building more robust testing. Anyone interested, please reach out to me! |
Thanks @MaximG1234 for reviewing the code. Hope this plug in will be ready soon for 4.3 👍 |
I tried running your source @madewithfire @MaximG1234 Keep getting following error when running TypeLoadException: Could not load type 'Microsoft.AspNetCore.Authentication.Internal.RequestPathBaseCookieBuilder' from assembly 'Microsoft.AspNetCore.Authentication, Version=3.1.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. Is it dotnetcore version issue ? Microsoft.AspNetCore.Authentication.JwtBearer has Microsoft.IdentityModel.Protocols.OpenIdConnect dependensy. |
@nareshyalagala Hey mate, you should find that if you add the nuget package 'Microsoft.AspNetCore.Authentication' the project should compile successfully. I'll take a look next checkin and make sure its part of the project in future. |
Compiling fine. But when I run the code and install plugin it wont work |
This is not working with Facebook External Authentication plugin. It gives an error when you try to execute the request from other controllers except token controller.
|
Hi @cygnet-dev , I've actually also run into the same problem but from the best I can tell at this stage this is actually a bug in the Facebook External Authentication plugin. Specifically it looks like regardless of the state of the Facebook Authentication Plugin (i.e. active/inactive) it disregards this value and intercepts requests in the pipeline regardless. For me it was sufficient to simply disable facebook authentication however if you require it it may be necessary to set the AppId parameter for the Authentication plugin prior to using the API. @nareshyalagala Unfortunately at this stage I cant provide you further input beyond the source code I have provided, based on my testing the code currently checked in does work successfully (kinda). I am still working on this code and expect that I will have further updates in the coming days. |
Hi everyone, I've just checked in a version @ https://github.com/MaximG1234/api-plugin-for-nopcommerce that is somewhat tested. I'd still consider this nowhere near ready for production but the API major functionality mostly works. It seems I have also discovered a minor limitation in LinqToDB (used by Nop for data access now) itself which limits some operations that are performed by the API. Specifically LinqToDb cannot perform GroupBy without materializing objects. This means there is going to be a performance and memory impact when querying customers or other operations that require grouping. In particular this affected the Customer Controller which I have rewritten and simplified but now materializes in memory. I imagine there are some way to improve/work around these issues and I'll revisit them soon. |
Thank you for your contributor. Can you tell me how to add Swagger into Api plugin? I tried but I just got only one /Token endpoint displaying on the Swagger page. I don't understand why is that. One point I figure out that TokenController is the one not inherit BaseApiController. Any suggestion will be greatly appreciate. Thank you in advance. |
@MaximG1234 after installed plugin it throw this error : |
@MaximG1234 Do you have a compiled version of the plugin available for fast deployment? |
@MaximG1234 , you mentioned:
That's a tough pill to swallow. Can you elaborate on why? (I use webhooks in backend order flow/automation.) |
@MaximG1234 and @madewithfire Thanks for the awesome work in updating this plugin! I'm trying to get it up and running so I can start testing it out on my setup, but I cannot find the correct authentication information. Thanks again! |
@Nickman87, To generate the token, you can use nopcommerce's credentials. After getting the token, pass it with "Bearer" in header. You also need to assign ApiUser role to the user. |
How can i configure route? I was able to download api plugin from https://github.com/MaximG1234/api-plugin-for-nopcommerce. tried posting https://localhost:44316/Api/api/login but response was HTML response |
http://localhost/...../api/token |
Hi everyone, Im new with the nopcommerce, i tried to add this plugin manually, but i dont know how to access the plugin UI in the admin, i cant see it and maybe the nopcommerce is not detecting the plugin as installed, so, how can i do that? |
Hi, |
Hi Please follow me:
I apologize because my english is not good :) |
Hi @MaximG1234,
It´s looks like working fine, I can get the access_token in a response json like this: {"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOiIxNjA3NDM0MTI5IiwiZXhwIjoiMTkyMjc5NDEyOSIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6Im5ha2Ftb3RvQG5ldGZhc2hpb24uY29tLmJyIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZWlkZW50aWZpZXIiOiJhMTRjZTNjMS04YTFmLTQ4MGQtYTE2YS0zMmY2MWIxZWFhZTgiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoibmFrYW1vdG9AbmV0ZmFzaGlvbi5jb20uYnIifQ.RYFhlSjzHjOMNM7qdgYobjyhuvwlDAjGP4GTwklbMdc","token_type":"Bearer","expires_in":1922794129,"error_description":null} But when i try to use the access token in any API transaction, like: I am getting the message: "User authenticated but not in Api Role." By the way, the user I used in step 1 is assigned to role "API User" in my web site Where am I doing any mistake?? Thanks. |
Hi,
Same thing I faced! you have to give API_User (check spell) role to the
user in order to use api.
Regards,
Prateek Bhardwaj
…On Tue, 8 Dec 2020 at 19:34, nakamoto9999 ***@***.***> wrote:
Hi @MaximG1234 <https://github.com/MaximG1234>,
I implemented your 4.30 API plugin, but I can´t get success in the use.
Take a look:
1. I started to get access token using
***@***.***&password=xxx
It´s looks like working fine, I can get the access_token in a response
json like this:
{"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOiIxNjA3NDM0MTI5IiwiZXhwIjoiMTkyMjc5NDEyOSIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6Im5ha2Ftb3RvQG5ldGZhc2hpb24uY29tLmJyIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZWlkZW50aWZpZXIiOiJhMTRjZTNjMS04YTFmLTQ4MGQtYTE2YS0zMmY2MWIxZWFhZTgiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoibmFrYW1vdG9AbmV0ZmFzaGlvbi5jb20uYnIifQ.RYFhlSjzHjOMNM7qdgYobjyhuvwlDAjGP4GTwklbMdc","token_type":"Bearer","expires_in":1922794129,"error_description":null}
1.
But when i try to use the access token in any API transaction, like:
http://mysite/api/products/count?access_token=eyJ......Mdc
I am getting the message:
"User authenticated but not in Api Role."
By the way, the user I used in step 1 is assigned to role "API User" in my
web site
Where am I doing any mistake??
Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#223 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APKG4SCVB7NLFVVIRXT7SBLSTYW5LANCNFSM4N3GKTLA>
.
|
Hi @Prateek58 , I changed the Customer Role Name to "API_User" (the System Name is "ApiUserRole") but the result remains the same. Finally, which of these API solutions are you using? All of these plugins are support 4.30 . Regards. |
I also got the same issue but I applied the apiuser role in this section. Please follow the image as I have listed out the steps required. If this works than give a thumbs up. Image Link: https://ibb.co/zFMg6Xm |
… On Thu, 10 Dec 2020 at 09:23, PoirkhitSaikia ***@***.***> wrote:
Hi @Prateek58 <https://github.com/Prateek58> ,
Thanks for your response.
I changed the Customer Role Name to "API_User" (the System Name is
"ApiUserRole") but the result remains the same.
I realized that, even if I don't put access_token when requesting any
services in the API, ( http://mysite/api/products/count for instance) the
answer is always the same:
"User authenticated but not in Api Role."
Finally, which of these API solutions are you using?
https://github.com/madewithfire/api-plugin-for-nopcommerce
https://github.com/MaximG1234/api-plugin-for-nopcommerce
https://github.com/zakaryaasadi/api_for_nopcommerce
https://github.com/toddca/api-plugin-for-nopcommerce/tree/nopCommerce_4.30
All of these plugins are support 4.30 .
Regards.
Hi @nakamoto9999 <https://github.com/nakamoto9999>
I also got the same issue but I applied the apiuser role in this section.
Please follow the image as I have listed out the steps required. If this
works than give a thumbs up.
Image Link: https://ibb.co/zFMg6Xm
[image: Screenshot (1195)]
<https://user-images.githubusercontent.com/52744625/101719405-44ada400-3ac9-11eb-90e2-bf1398a6227d.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#223 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APKG4SDRQBQS7PGDFHFRZLTSUBA2TANCNFSM4N3GKTLA>
.
|
Hi @Prateek58 , I already pushed the thumbs up. You gave me a great Christmas gift !! |
Thanks and happy christmas in advance!
Due to lack of proper documentation of API plugin I also faced some issues.
Regards,
PrateeK Bhardwaj
…On Thu, 10 Dec 2020 at 19:31, nakamoto9999 ***@***.***> wrote:
Hi @Prateek58 <https://github.com/Prateek58> ,
It´s working now ! Tahe a look at response of Postman panel...
[image: image]
<https://user-images.githubusercontent.com/16842559/101781317-65c8c180-3ad6-11eb-9e6a-e062008a6943.png>
I already pushed the thumbs up. You gave me a great Christmas gift !!
Regards.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#223 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APKG4SGJIZ6SHD3AZQ3BGETSUDID7ANCNFSM4N3GKTLA>
.
|
Go to Facebook Auth plugin, and put random (or real if you are using it) data there. |
Hello Developers, Can anyone let me know where I will get full API list for version 4.2? Most of the APIs are not available in github. How to progress like this? |
Hello, I implemented TopicController in this apiplugin for nop 4.3 https://github.com/madewithfire/api-plugin-for-nopcommerce Any idea to fix this? These new changes are in this repo https://github.com/Red-Transact/api-plugin-for-nopcommerce PS: @madewithfire You need to create a new branch for 4.3 still its nopCommerce_4.20 :) |
Fixed above issue by adding |
Hi , I got stuck with this AppId problem on the api calls, |
Any consensus on which of these forks is best? I've tried a number of them but it that none of them have a complete features for "customer search", "checkout", or "add new customer address". |
Hi everyone, I'm new with the nopcommerce, I tried to add this plugin manually in my local machine, but could not do it. Even tried with steps as well: How can we use postman for API integrations with Nopcommerce, any suggestions or links? Which of these API solutions are best to use All of these plugins are support 4.30? Thanks |
1 similar comment
Hi everyone, I'm new with the nopcommerce, I tried to add this plugin manually in my local machine, but could not do it. Even tried with steps as well: How can we use postman for API integrations with Nopcommerce, any suggestions or links? Which of these API solutions are best to use All of these plugins are support 4.30? Thanks |
Hey @poyker and @MaximG1234 , Thanks for great plugin, I also know that it is free plugin. But if you can update it for 4.30, both community and also paid customers will appreciate it. (I'm also one your paid customer for your other products.) I also noticed there is 4.30-beta branch , when do you plan to make it ready for production? Thanks, |
Split this into a new issue |
Thanks for great plugin and helping community.... |
Can we please get some consensus on the which of the multiple repos out there we can use? |
Agree.. we need a community fork. I'd think about choosing a set of maintainers to start a new community fork. Otherwise we'll run into the same issues on someone else's fork. |
Disagree, but only due to recent developments. There's a new milestone attached to nopCommerce 4.5 to include Web API support natively in the core product. This was hanging around as an open issue there, but it now appears to be getting traction. I can only assume that the efforts of anyone looking to contribute would be better served by helping and advancing over there, as this plugin will almost certainly become redundant if that milestone gets completed. I for one would prefer to work on a fork of the core, as there will likely be better testing. Admittedly, that could push completion down the road a bit though. |
Hi guys, There is already a 4.3 Beta branch based on the contributed code here. |
Thanks for great free plugin, But if any one can update it for 4.40 and share, we in nopcommerce community, all will appreciate. |
Go ahead, it's not that hard. You need to take one of 4.3 forks and change all methods to async await. It's not hard to do, but it's very time consuming. Nop says they will introduce their own api with 4.5 |
I did it previously, with few api calls of customer only. However unlucky, there were runtime issues. |
@amzr0987 Check out my fork at https://github.com/stepanbenes/api-for-nopcommerce. I have done most of the work to update it for 4.40. Mainly change all methods to their async alternatives. Some work still needs to be done, so feel free to contribute. |
Thanks Stepanbenes for upgraded to NC 4.40, |
Thanks Stepanbenes for upgraded to NC 4.40, |
@amzr0987 I have updated the readme file to describe how to install the plugin. You can test the api in localhost using swagger UI page (/api/swagger). Currently, there is no client application for testing implemented. |
Hi, it would be great to have the plugin working on 4.3.
Regards,Danny
The text was updated successfully, but these errors were encountered: