From 44335dad711afef4f67ed24669972842fe0391d7 Mon Sep 17 00:00:00 2001 From: Dasuni Geeganage Date: Mon, 6 May 2024 10:15:51 +0530 Subject: [PATCH 1/2] Update the readme file --- petcare-sample/b2c/web-app/petdesk/README.md | 77 +++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/petcare-sample/b2c/web-app/petdesk/README.md b/petcare-sample/b2c/web-app/petdesk/README.md index 307eaa547..70ebe6878 100644 --- a/petcare-sample/b2c/web-app/petdesk/README.md +++ b/petcare-sample/b2c/web-app/petdesk/README.md @@ -4,10 +4,13 @@ The Pet Management Application is a B2C (Business-to-Consumer) application that There are two ways that you can run this sample application -- [Using Cloud Deployment](#using-cloud-deployment) -- [Run Locally](#run-locally) +- Method 1: [Using Cloud Deployment](#️-method-1-using-cloud-deployment) +- Method 2: [Run Locally](#️-method-2-run-locally) -# Using Cloud Deployment + 

+ +# ✍️ Method 1: Using Cloud Deployment This guide will show you how to use [Asgardeo](https://wso2.com/asgardeo/), WSO2's SaaS Customer IAM (CIAM) solution to secure user authentication to the web application and add CIAM features to your web application. Also to use [Choreo](https://wso2.com/choreo/) to expose a service endpoint as a REST API and safely consume the API from a web application.  
@@ -457,7 +460,10 @@ Now you have generated keys for the application. - Provide an email address. - Click **Save**. -# Run Locally + 

+ +# ✍️ Method 2: Run Locally # B2C PetDesk Sample Application Setup Guide @@ -469,7 +475,37 @@ Now you have generated keys for the application. When deploying the webhook through choreo, provide the salesforce related configuration mention as in salesforce-integration-service deployment. -## Deploy API Services + +## Create an Application in WSO2 Identity Server +1. Create a Single-Page Application named `Pet Desk App` in root organization. +2. Add the `Authorized redirect URLs` as `http://localhost:3000`. +3. Go to the `Protocol` tab and copy the `Client ID`. +4. Select `Access token` type as `JWT`. + +## Deploy the Front End Application +1. Navigate to /petcare-sample/b2c/web-app/petdesk/web/react/public and update the configuration file + `config.js` with the registered app details. + + ``` + baseUrl: "https://localhost:9443", + clientID: "", + signInRedirectURL: "http://localhost:3000", + signOutRedirectURL: "http://localhost:3000", + petManagementServiceURL: "http://localhost:9090", + billingServerURL: "http://localhost:9091", + salesforceServerURL: "http://localhost:9092", + scope: ["openid", "email", "profile"] + myAccountAppURL: "", + enableOIDCSessionManagement: true + ``` +2. Run the application by executing the following command in the terminal. + ``` + npm install + npm start + ``` +3. Visit the sample application at http://localhost:3000. + +## Run API Services 1. Navigate to /petcare-sample/b2c/web-app/petdesk/apis/ballerina/pet-management-service and start the pet management service by executing the following command in the terminal. ``` @@ -551,33 +587,4 @@ dbUsername = "" dbPassword = "" dbDatabase = "" dbPort = "" -``` - -## Create an Application in WSO2 Identity Server -1. Create a Single-Page Application named `Pet Desk App` in root organization. -2. Add the `Authorized redirect URLs` as `http://localhost:3000`. -3. Go to the `Protocol` tab and copy the `Client ID`. -4. Select `Access token` type as `JWT`. - -## Deploy the Front End Application -1. Navigate to /petcare-sample/b2c/web-app/petdesk/web/react/public and update the configuration file - `config.js` with the registered app details. - - ``` - baseUrl: "https://localhost:9443", - clientID: "", - signInRedirectURL: "http://localhost:3000", - signOutRedirectURL: "http://localhost:3000", - petManagementServiceURL: "http://localhost:9090", - billingServerURL: "http://localhost:9091", - salesforceServerURL: "http://localhost:9092", - scope: ["openid", "email", "profile"] - myAccountAppURL: "", - enableOIDCSessionManagement: true - ``` -2. Run the application by executing the following command in the terminal. - ``` - npm install - npm start - ``` -3. Visit the sample application at http://localhost:3000. +``` \ No newline at end of file From 2f80b0f4bf8287ba4ab1b50382f2397698c760d2 Mon Sep 17 00:00:00 2001 From: Dasuni Geeganage Date: Mon, 6 May 2024 10:17:24 +0530 Subject: [PATCH 2/2] Add blank line --- petcare-sample/b2c/web-app/petdesk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/petcare-sample/b2c/web-app/petdesk/README.md b/petcare-sample/b2c/web-app/petdesk/README.md index 70ebe6878..88e74f01f 100644 --- a/petcare-sample/b2c/web-app/petdesk/README.md +++ b/petcare-sample/b2c/web-app/petdesk/README.md @@ -587,4 +587,4 @@ dbUsername = "" dbPassword = "" dbDatabase = "" dbPort = "" -``` \ No newline at end of file +```