> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Sample Flows ## Article: Sample Flows ## Article Link: https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/sample-flows.md ## Article Content: # OAuth Apps: Sample Use Cases & Flows This article shares some possible use cases you could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your implementation. ## Connect a custom template on any platform to an existing Wix project You can create a frontend template, on an external platform, that takes advantage of business solutions on a Wix site or project. For any external app or site to access a Wix project's data, it must be authorized in advance by creating an OAuth app. To enable project owners to connect a site or app built on your template to their existing Wix project data, follow these steps: 1. Create a template on any platform and integrate Wix API calls ([JavaScript SDK](https://dev.wix.com/docs/sdk.md) or [REST](https://dev.wix.com/docs/rest.md)) to access and manage business solutions in a Wix project. 1. Create a [Wix app](https://dev.wix.com/docs/build-apps/get-started/overview/about-wix-apps.md) that a site or project owner can install. 1. Make sure your app requests the Manage OAuth Apps permission scope. 1. Obtain the domain name for the deployment of the site or app built on the template. 1. In your app code, call [Create OAuth App](https://dev.wix.com/docs/rest/business-management/headless-authentication/oauth-apps/create-oauth-app.md). Specify a `name` and optional `description` that identify the client clearly. In the `allowedDomains` array, provide the deployment domains from the previous step. 1. Store the returned OAuth app's `id` securely. 1. Assign the ID to a secure environment variable in the template code. The template can now access the Wix project's data. ## Change allowed redirect domains for an external client app or site Whenever an external client redirects a visitor to Wix for authentication, the client provides a URL for Wix to redirect the visitor back to after authentication. To ensure security, Wix only redirects the visitor if the domain has been approved in advance in the OAuth app's settings. To update an external client's approved URLs, follow these steps: 1. Make sure you have the OAuth app ID for the external client. 1. Obtain a complete list of domains to approve for the external site or app. 1. Call [Update OAuth App](https://dev.wix.com/docs/rest/business-management/headless-authentication/oauth-apps/update-oauth-app.md) with the OAuth app ID as a path parameter. Pass all approved domains in the `oAuthApp.allowedDomains` body parameter, and pass `["allowedDomains"]` in the `mask.paths` body parameter. 1. The external app or site can now provide any redirect URL from the updated list.