### Install and Start Sample Application Source: https://github.com/wso2/docs-is/blob/master/en/asgardeo/docs/get-started/try-samples/qsg-spa-javascript.md Run this command in the root of the project to install dependencies and start the sample application. ```bash npm install && npm start ``` -------------------------------- ### Install Dependencies and Start App Source: https://github.com/wso2/docs-is/blob/master/en/includes/complete-guides/expressjs/create-an-expressjs-app.md Navigate to the project directory and install the necessary dependencies. Then, start the Express.js application. ```bash cd passport-{{product}}-sample npm install ``` ```bash npm start ``` -------------------------------- ### WSO2 Identity Server Linux Service Startup Script Example Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/get-started/install.md An example startup script tailored for WSO2 Identity Server, including environment variable setup and service control commands. It demonstrates starting the server as a specific user. ```bash #! /bin/sh ### BEGIN INIT INFO # Provides: wso2is # Required-Start: $all # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: # Short-Description: starts the wso2 identity server ### END INIT INFO export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" export CARBON_HOME="/home/ubuntu/wso2is-{{is_version}}" startcmd="${CARBON_HOME}""/bin/wso2server.sh start > /dev/null &" restartcmd="${CARBON_HOME}""/bin/wso2server.sh restart > /dev/null &" stopcmd="${CARBON_HOME}""/bin/wso2server.sh stop > /dev/null &" case "$1" in start) echo "Starting WSO2 Identity Server ..." su -c "${startcmd}" user1 ;; restart) echo "Re-starting WSO2 Identity Server ..." su -c "${restartcmd}" user1 ;; stop) echo "Stopping WSO2 Identity Server ..." su -c "${stopcmd}" user1 ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac ``` -------------------------------- ### Quickstart Guide Frontmatter Source: https://github.com/wso2/docs-is/blob/master/CONTRIBUTING.md Use this frontmatter block for new quickstart guide files. It includes template information and a JavaScript object for metadata, followed by H2 headings for steps. ```markdown --- template: templates/quick-start.html --- # Heading Description text [//] STEPS_START ## Step 1 Some Content ## Step 2 Some Content [//] STEPS_END ``` -------------------------------- ### Start User Store Agent (Windows) Source: https://github.com/wso2/docs-is/blob/master/en/asgardeo/docs/guides/users/user-stores/configure-a-user-store.md Execute this command in the root directory of the user store agent to start the service on Windows systems. You will be prompted to enter the installation token. ```batch wso2agent.bat -- run ``` -------------------------------- ### Get help for WSO2 Identity Server commands Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/get-started/run-the-product.md Append '-help' to the server start command to view available actions and options. ```bash sh /bin/wso2server.sh -help ``` -------------------------------- ### Complete Guide Frontmatter Configuration Source: https://github.com/wso2/docs-is/blob/master/CONTRIBUTING.md This is an example of the frontmatter configuration required for a complete guide documentation file. It specifies the template, heading, and estimated read time. ```yaml --- template: templates/complete-guide.html heading: Introduction read_time: 2 mins --- ``` -------------------------------- ### Securing MCP Server with @asgardeo/mcp-express Source: https://context7.com/wso2/docs-is/llms.txt This section details how to use the @asgardeo/mcp-express middleware to secure Model Context Protocol (MCP) servers. It includes installation instructions, a server setup example, and testing instructions. ```APIDOC ## Secure MCP Server with `@asgardeo/mcp-express` The `@asgardeo/mcp-express` middleware secures Model Context Protocol (MCP) servers with OAuth 2.1 compliant authentication, enabling AI agents to access tools with Asgardeo-issued access tokens. ```bash npm install @asgardeo/mcp-express @modelcontextprotocol/sdk express cors dotenv ``` ```typescript // server.ts import 'dotenv/config'; import express from 'express'; import cors from 'cors'; import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { configuredAuthServer as auth } from '@asgardeo/mcp-express'; import { z } from 'zod'; const app = express(); app.use(cors({ origin: '*', exposedHeaders: ['Mcp-Session-Id'] })); app.use(express.json()); // Create and configure MCP server const server = new McpServer({ name: 'my-mcp-server', version: '1.0.0' }); server.registerTool( 'add', { title: 'Addition Tool', description: 'Add two numbers', inputSchema: { a: z.number(), b: z.number() } }, async ({ a, b }) => ({ content: [{ type: 'text', text: String(a + b) }] }) ); // Register Asgardeo OAuth endpoints (discovery, token, etc.) app.use(auth.router()); // Protect the /mcp endpoint — requires valid Asgardeo access token app.post('/mcp', auth.protect(), async (req, res) => { const transport = new StreamableHTTPServerTransport({ enableJsonResponse: true }); res.on('close', () => transport.close()); await server.connect(transport); await transport.handleRequest(req, res, req.body); }); app.listen(3000, () => console.log('MCP server running at http://localhost:3000/mcp')); ``` ```bash # .env BASE_URL=https://api.asgardeo.io/t/ # Test with MCP Inspector (registers as an MCP client in Asgardeo Console first): npx @modelcontextprotocol/inspector --url http://localhost:3000/mcp --transport streamable-http ``` ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/wso2/docs-is/blob/master/en/asgardeo/docs/complete-guides/nextjs-b2b/create-app.md Change into the newly created project directory to start development. ```bash cd my-b2b-app ``` -------------------------------- ### Create and Navigate to Agent Directory Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/agent-auth-ts.md Creates a new directory for the agent authentication quickstart and navigates into it. ```bash mkdir agent-auth-quickstart cd agent-auth-quickstart ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/wso2/docs-is/blob/master/en/includes/complete-guides/javascript/create-app.md After creating the project, navigate into the project directory and run this command to install all necessary dependencies. ```bash cd wso2-javascript npm install ``` -------------------------------- ### Start Sample Application Services Source: https://github.com/wso2/docs-is/blob/master/en/includes/tutorials/secure-agentic-ai-systems.md Run this script to start all the necessary services for the hotel booking agent application. Ensure you have configured the .env files in each service directory. ```bash ./start-services.sh ``` -------------------------------- ### Install Angular CLI Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/angular.md Install Angular CLI version 17. This guide is compatible only with this version. ```bash npm install -g @angular/cli@17 ``` ```bash yarn global add @angular/cli@17 ``` ```bash pnpm add -g @angular/cli@17 ``` -------------------------------- ### Start WSO2CARBON Windows Service Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/get-started/install.md Start the installed WSO2CARBON Windows service. Requires administrative privileges. ```bash startService.bat ``` -------------------------------- ### Serve Business App Source: https://github.com/wso2/docs-is/blob/master/en/includes/guides/organization-management/try-a-b2b-use-case.md Execute this command to start the business application development server. ```bash npx nx serve business-app ``` -------------------------------- ### Serve Documentation Locally Source: https://github.com/wso2/docs-is/blob/master/README.md Start the local development server for MkDocs to preview the documentation. If the 'mkdocs' command is not found, use 'python3 -m mkdocs serve'. ```bash mkdocs serve ``` ```bash python3 -m mkdocs serve ``` -------------------------------- ### JMX Service URL Example Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/monitor/jmx-based-monitoring.md This is an example of the JMX Service URL that will be published on the console when WSO2 Identity Server starts with JMX enabled. ```text INFO {org.wso2.carbon.core.init.CarbonServerManager} - JMX Service URL : service:jmx:rmi://:11111/jndi/rmi://:9999/jmxrmi ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/wso2/docs-is/blob/master/en/asgardeo/docs/complete-guides/nextjs/create-app.md After creating the app, change into the project directory to start working on it. ```bash cd my-nextjs-app ``` -------------------------------- ### Sample GET Request for Super Tenant Search Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/apis/retrieve-tenant-resources-based-on-search-parameters.md Example of a GET request to search for resources in the super tenant, filtering by tenant domain. ```java https://localhost:9443/api/identity/config-mgt/v1.0/search?filter=tenantDomain eq ‘carbon.super’ ``` -------------------------------- ### Example Flow Execution Response Source: https://github.com/wso2/docs-is/blob/master/en/includes/guides/flows/flow-execution-api.md This is an example of the response received when starting a flow execution. It includes details about the flow, its status, and the components for the client to render. ```json { "flowId": "c8e06de8-7123-44ac-8209-02be5b55387e", "flowType": "REGISTRATION", "flowStatus": "INCOMPLETE", "type": "VIEW", "data": { "components": [ { "id": "form_1", "type": "FORM", "components": [ { "id": "email", "type": "INPUT", "variant": "EMAIL", "config": { "identifier": "http://wso2.com/claims/emailaddress", "label": "Email", "required": true } }, { "id": "password", "type": "INPUT", "variant": "PASSWORD", "config": { "identifier": "password", "label": "Password", "required": true } }, { "id": "submit", "type": "BUTTON", "actionId": "submit-registration", "variant": "PRIMARY", "config": { "text": "Continue" } } ] } ] } } ``` -------------------------------- ### HTTP GET Request Example Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/references/conditional-auth/api-reference.md Sends an HTTP GET request to a specified endpoint with optional headers and authentication configuration. Handles success and failure callbacks. ```javascript var authConfig = { type: "basic", properties: { username: "admin", password: "adminPassword" } }; var onLoginRequest = function(context) { httpGet('https://example.com/resource', { "Accept": "application/json" }, authConfig, { onSuccess: function(context, data) { Log.info('httpGet call succeeded'); context.selectedAcr = data.status; executeStep(1); }, onFail: function(context, data) { Log.info('httpGet call failed'); context.selectedAcr = 'FAILED'; executeStep(2); } }); } ``` -------------------------------- ### Set up Environment Variables Source: https://github.com/wso2/docs-is/blob/master/en/includes/complete-guides/app-native/configure-provider.md Configure your Next.js application by creating a .env file with the necessary Asgardeo SDK configuration values. ```bash NEXT_PUBLIC_ASGARDEO_BASE_URL="{{content.sdkconfig.baseUrl}}" NEXT_PUBLIC_ASGARDEO_CLIENT_ID="" ASGARDEO_CLIENT_SECRET="" ``` -------------------------------- ### Example Subscription Verification Request Source: https://github.com/wso2/docs-is/blob/master/en/includes/guides/webhooks/setup-webhooks.md This is an example of an HTTP GET request {{product_name}} sends to verify your webhook endpoint subscription. Your endpoint must respond with the hub.challenge value. ```http GET /hub.mode=subscribe&hub.topic=myorg.dcbd6baa-40c7-4eb9-9c2e-19b868d0e266.schema.wso2.v1.event.login&hub.challenge=500c4833-91c6-4556-b9a9-1b8e5e00d48b&hub.lease_seconds=864000 ``` -------------------------------- ### Generate Keystore with SAN (Sample PKCS12) Source: https://github.com/wso2/docs-is/blob/master/en/includes/deploy/change-the-hostname.md Example command to generate a PKCS12 keystore with a specific hostname and SANs, including localhost. ```java keytool -genkey -alias newcert -keyalg RSA -keysize 2048 -keystore newkeystore.p12 -storetype PKCS12 -dname "CN=is.dev.wso2.com, OU=Is,O=Wso2,L=SL,S=WS,C=LK" -storepass mypassword -keypass mypassword -ext SAN=dns:localhost,dns:is.dev.wso2.com ``` -------------------------------- ### Fetch JWKS using Node.js (Axios) Source: https://github.com/wso2/docs-is/blob/master/en/includes/guides/authentication/oidc/validate-id-tokens.md This Node.js example uses the Axios library to fetch the JWKS. Make sure you have Axios installed (`npm install axios`) and imported into your project. ```javascript var axios = require('axios'); var config = { method: 'get', url: '{{ product_url_sample }}/oauth2/jwks', headers: {} }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); }); ``` -------------------------------- ### Serve the Frontend Application Source: https://github.com/wso2/docs-is/blob/master/en/includes/guides/organization-management/try-a-b2b-use-case-pet-care.md Start the Pet Care frontend application using the Nx build tool. The application will be accessible at http://localhost:3002. ```bash npx nx serve business-admin-app ``` -------------------------------- ### Set JAVA_HOME on macOS Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/get-started/install.md Configure the JAVA_HOME environment variable. Replace the example path with your actual JDK installation directory. ```bash export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.14/Contents/Home ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/wso2/docs-is/blob/master/en/includes/complete-guides/actions/pre-issue-access-token-action-in-choreo.md Install necessary libraries for building the web service, validating input, making HTTP requests, and managing environment variables. ```bash npm install dotenv express geoip-country ``` -------------------------------- ### SameSite=Lax Cookie Example Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/samesite-attribute-support.md Demonstrates the 'Lax' value for the SameSite attribute. Cookies are sent with GET requests that cause top-level navigation. ```bash Set-Cookie: CookieName=CookieValue; SameSite=Lax; ``` -------------------------------- ### Install Next.js SDK Source: https://context7.com/wso2/docs-is/llms.txt Install the @asgardeo/nextjs SDK using npm. ```bash npm install @asgardeo/nextjs ``` -------------------------------- ### Outbound Provisioning Username Example Source: https://github.com/wso2/docs-is/blob/master/en/includes/guides/users/outbound-provisioning/provisioning-patterns.md Demonstrates how a provisioning pattern and separator combine user attributes to form a unique username for an external system. This example shows the resulting username for a user provisioned with a specific pattern and separator. ```bash primary-user@provisioning.com-carbon.super-salesforce ``` -------------------------------- ### JDBC Database Call Log Example Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/monitor/work-with-product-observability.md An example log entry for a JDBC database call, demonstrating the format with actual values for timestamp, correlation ID, thread ID, duration, call type, start time, method name, query, and connection URL. ```text 2018-10-22 17:54:46,869|cf57a4a6-3ba7-46aa-8a2b-f02089d0172c|http-nio-9443-exec-2|4|jdbc|1540211086865|executeQuery|SELECT ID, TENANT_ID, IDP_ID, PROVISIONING_CONNECTOR_TYPE, IS_ENABLED, IS_BLOCKING FROM IDP_PROVISIONING_CONFIG WHERE IDP_ID=?|jdbc:mysql://localhost:13306/apimgtdb?autoReconnect=true&useSSL=false ``` -------------------------------- ### Update Keystore Configuration (Sample PKCS12) Source: https://github.com/wso2/docs-is/blob/master/en/includes/deploy/change-the-hostname.md Example configuration for a PKCS12 keystore in `deployment.toml`. ```toml [keystore.primary] file_name = "newkeystore.p12" password = "mypassword" alias = "newcert" key_password = "mypassword" type = "PKCS12" ``` -------------------------------- ### Start WSO2 Server (Linux) Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/security/resolve-encrypted-passwords.md Run the WSO2 server start-up script from the \`\`/bin directory. You will be prompted to enter the KeyStore and Private Key Password. ```console ./wso2server.sh ``` -------------------------------- ### Create Vue App with Vite (pnpm) Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/vue.md Scaffold a new Vue application using Vite and pnpm. Installs dependencies and starts the development server. ```bash pnpm create vite@latest {{ product }}-vue -- --template vue cd {{ product }}-vue pnpm install pnpm dev ``` -------------------------------- ### Create Vue App with Vite (yarn) Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/vue.md Scaffold a new Vue application using Vite and yarn. Installs dependencies and starts the development server. ```bash yarn create vite@latest {{ product }}-vue -- --template vue cd {{ product }}-vue yarn install yarn dev ``` -------------------------------- ### Create Project Folder Source: https://github.com/wso2/docs-is/blob/master/en/includes/complete-guides/actions/pre-issue-access-token-action-in-vercel.md Initializes a new project directory for the token policy validator. Navigate into this directory to continue setup. ```bash mkdir token-policy-validator cd token-policy-validator ``` -------------------------------- ### Start Fluent Bit Service Source: https://github.com/wso2/docs-is/blob/master/en/includes/guides/analytics/opensearch.md Use this command to start the Fluent Bit service. Ensure you replace `` with the actual path to your configuration file. ```bash fluent-bit -c ``` -------------------------------- ### Create Vue App with Vite (npm) Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/vue.md Scaffold a new Vue application using Vite and npm. Installs dependencies and starts the development server. ```bash npm create vite@latest {{ product }}-vue -- --template vue cd {{ product }}-vue npm install npm run dev ``` -------------------------------- ### Create React App with Vite (pnpm) Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/react.md Scaffold a new React application using Vite and pnpm. Installs dependencies and starts the development server. ```bash pnpm create vite@latest {{ product }}-react -- --template react cd {{ product }}-react pnpm install pnpm dev ``` -------------------------------- ### Navigate to Documentation Directory Source: https://github.com/wso2/docs-is/blob/master/README.md Change to the specific documentation directory for Asgardeo or Identity Server. ```bash cd en/asgardeo ``` ```bash cd en/identity-server/{version} ``` -------------------------------- ### Generate Keystore with SAN (Option 2 Sample PKCS12) Source: https://github.com/wso2/docs-is/blob/master/en/includes/deploy/change-the-hostname.md Example command to generate a PKCS12 keystore with a specific hostname, where only the primary hostname is added to the SAN. ```java keytool -genkey -alias newcert -keyalg RSA -keysize 2048 -keystore newkeystore.p12 -storetype PKCS12 -dname "CN=is.dev.wso2.com, OU=Is,O=Wso2,L=SL,S=WS,C=LK" -storepass mypassword -keypass mypassword -ext SAN=dns:is.dev.wso2.com ``` -------------------------------- ### Create React App with Vite (yarn) Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/react.md Scaffold a new React application using Vite and yarn. Installs dependencies and starts the development server. ```bash yarn create vite@latest {{ product }}-react -- --template react cd {{ product }}-react yarn install yarn dev ``` -------------------------------- ### Run the Development Server Source: https://github.com/wso2/docs-is/blob/master/en/asgardeo/docs/complete-guides/nextjs/create-app.md Start the Next.js development server to view your application locally. This command compiles the app and makes it available at http://localhost:3000. ```bash npm run dev # or yarn dev ``` -------------------------------- ### Create React App with Vite (npm) Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/react.md Scaffold a new React application using Vite and npm. Installs dependencies and starts the development server. ```bash npm create vite@latest {{ product }}-react -- --template react cd {{ product }}-react npm install npm run dev ``` -------------------------------- ### Get Real Java Path on macOS Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/get-started/install.md If 'which java' returns a symbolic link, use this command to find the actual JDK installation path. ```bash ls -l `which java` ``` -------------------------------- ### Beginning of Request Call Log Example Source: https://github.com/wso2/docs-is/blob/master/en/identity-server/7.2.0/docs/deploy/monitor/work-with-product-observability.md An example log entry for the beginning of an incoming request call, demonstrating the format with actual values for timestamp, correlation ID, thread ID, duration, HTTP method, start time, method name, request query, and request path. ```text 2018-11-0514:57:06,757|f884a93d-e3a3-431f-a1ea-f6973e125cb6|http-nio-9443-exec-28|0|HTTP-In-Request|1541410026757|GET|null|/carbon/admin/images/favicon.ico ``` -------------------------------- ### Create Project Directory and Virtual Environment Source: https://github.com/wso2/docs-is/blob/master/en/includes/quick-starts/agent-auth-py.md Sets up the project directory and activates a Python virtual environment. Choose the commands appropriate for your operating system. ```bash mkdir agent-auth-quickstart cd agent-auth-quickstart ``` ```bash python3 -m venv .venv source .venv/bin/activate ``` ```bash python -m venv .venv .venv\Scripts\activate ```