OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce OAuth 2.0 Server: code-example for multistep client-application/microservice?

This topic contains 8 replies, has 3 voices, and was last updated by  Frank 4 years, 5 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #40891

    Frank
    Participant

    Hi there,

    I want to build up an rest api application (web microservice) using OAuth 2.0 Server Extension for authentication.

    I am a newbee on this field, learning a lot about rest apis in the last time, but I do not have practical experience at all.
    Could you recommend me some code-example, which handles a multistep application (some workflow, like shopping cart or other), where bearer access token is used for each request.

    Thank you very much in advance.

    Kind regards
    Frank

    PS. I would like to use Symfony/Api Platform for my client application. But this is not a ‘must be’ of course.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #40892

    Andrey Yatsenko
    Moderator

    OroCommerce uses own API framework and it has no integration with API Platform because of that.

    You can start from OroCommerce API Developer User Guide and the guide on using OAuth in OroCommerce.

    #40893

    Frank
    Participant

    … means, I have to use WSSE Authentication?

    Ok.

    The userguide descibes api in all aspects, but I did not find any code-example for an client application, which makes use of this api. Or am I wrong?

    Thanks a lot
    Frank.

    #40895

    Frank
    Participant

    oops. I am sorry. WSSE was the wrong way. You did mentioned OAuth above ..

    I have thought that the Oauth described in the userguide
    https://doc.oroinc.com/user/back-office/getting-started/user-menu/oauth/#user-guide-my-profile-oauth
    made use of the OAuth 2.0 extension …

    Obviously this was a missunderstanding.


    However, I created an application for OAuth as described in the userguide, and followed the steps to the end. Third Party Side: Generatation of Token was succesfull:

    I received response from the authorization server with a JSON object (token_type, expires_in, access_token) exactly as descibed.

    But how to go further on the client side?

    The guide says:
    Use the generated access token to make requests to the API.

    Hm.
    I can do that once for 1 URL. But how to build a full workflow, like shopping cart, or other I do not have an imagination at all.

    Could you give me a practical code-example for the Client-Application (web based microservice)? This would really help.

    Thanks for your effort.

    Kind regard
    Frank.

    #40897

    Andrey Yatsenko
    Moderator

    You can access the API Sandbox to see all the available actions in an OroCommerce application.

    There are two API’s, back-office API and storefront API, sandboxes are available by the following URLs:
    http://<hostname_of_your_oro_application>/api/doc – for the storefront
    http://<hostname_of_your_oro_application>/admin/api/doc – for the backoffice

    #40898

    Frank
    Participant

    Hi Andrey,

    yes, I know about different backend/storefront api-ressources, and I know about sandboxes (swagger ui). . But this tests only one certain request/response interaction.

    What I am looking for is an client application with multiple steps. In other words, how to connect the single steps to each other.
    In a typical web-application I use a SessionId for that, but an api do not have/make use of it.

    Best way, in order to understand the pronciple, how to build an whole client application would be a complete code-example….?!

    Thanks a lot.
    Frank

    #40900

    Frank
    Participant

    To illustrate my problem further:

    I am looking for an code-example, which makes use of the orocommerce web api to build a client frontend application.
    Finally I want to build something similiar to the shopping-cart-example from imega:
    http://shopcart.imega.club/

    Thanks for help
    Frank

    #40905

    Michael
    Keymaster

    Hi Frank,

    We do not provide tutorials on how to build a full client application using a different programming language/framework/technology stack. But there are plenty of tutorials (including ecommerce examples) available for any popular framework/language. For example, if you decide to build your client app using AngularJS – you can easily find a few interesting examples of ecommerce frontends integrated to some ecommerce platform via API, same for React – there are examples too, and so on. If you are looking to build a mobile client application – then again, you need to choose a technology stack first. There are multiple tutorials on building mobile frontends and interaction with the server via APIs for Android and Apple iOS using either native stack, or cross-platform solutions like React Native and Xamarin, etc.

    #40906

    Frank
    Participant

    Hi Michael,

    thanks for your reply on Saturday :-)

    Ok. Though I will have to drive deeper into the application technology stacks.

    Kind regards.
    Frank

Viewing 8 replies - 1 through 8 (of 8 total)

The forum ‘OroCommerce’ is closed to new topics and replies.

Back to top