Understanding Different Authentication Grant Type WorkFlows in Sitecore OrderCloud

Hello everyone,In my previous blog regarding OrderCloud, we have seen what is Buyer organization, Buyer User group, Buyer User and how they are related to each other. In this blog we will try to understand the Authentication mechanism used by Sitecore OrderCloud. What different grant types it support and how we can connect to a third party OpenID(basically for implementing Single Sign On) for implementing the same.

Sitecore OrderCloud mechanism is built on OAuth 2.0 to support both Authentication and Authorization.If you want to understand Authentication and Authroization you can refer my blog on the same Here.I have tried to explain using Sitecore and how it implement the same.

So lets get started. In Sitecore OrderCloud there are basically 6 GrantType Workflows which is listed below

  • Password Grant Type Workflow
  • Client Credential Workflow
  • Refresh Workflow
  • Elevated Password Workflow
  • Anonnymous Shopping Workflow
  • SSO Workflow

Password Grant Type Workflow : The most common grant type which uses Username and Password. Different parameters are passed with the request for successful authentication.

Client Credentials Workflow : This workflow mechanism is mostly used by backend system as we will be passing client secret along with client id for Authentication.

Refresh Workflow: This workflow is useful to refresh the access token without logging out of the system. It basically provide a seamless logged in experience. ApiClient.RefreshTokenDuration to be set greater than 0 in api setting. Once this is set, your authentication response will have refesh_token.

Elevated Password Workflow: Elevated Password is similar to Password workflow but with one extra paramter is passed in request body and that is Client Secret.

Anonymous Workflow: This flow is mostly used to provide the anonymous user with feature of browsing catalogs and products and even checkout with registering themselves on application.

SSO Workflow: This workflow is mostly used when we need to connect with Third party Authorization server with OpenID for authentication and authorization

Lets see, how we can create a API client in Sitecore OrderCloud portal.You can see in request where we are allowing which user can use these client id for Authentication. We need to generate the client secret and it totally depend on us. We have also added refresh token duration to provide user a seamless logged in experience to users.


Let's see some common error which can occur in Authentication. Below is the Snippet which will explain you in Detail.

Thanks for reading. Hope this blog will explain the Authentication mechanism used by Sitecore OrderCloud. Stay tune to more blogs regarding Sitecore OrderCloud

Happy Learning. Happy Sitecoring!!!

Comments

Popular posts from this blog

Sitecore XM Cloud Form Integration with Azure Function as Webhook

Automate RSS Feed to Sitecore XM Cloud: Logic App, Next.js API & Authoring API Integration

Create and Fetch Content From Sitecore Content Hub One using GraphQL and React