# Add the redirect URIs

## Navigate to the redirect URIs section

Redirect URIs are used to authenticate Swagger so that our API EndPoints can be run on it.

1. Type “**App registrations**" in the [Azure portal](https://portal.azure.com) search bar and select said option as it appears.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-a7632a54ba74fde45a68bda7433e9eb69cd82905%2F7.5.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Click on **Owned applications** to see a list of applications you registered and click on **EmbedFASTAuth**. \[image with correct name needed]
3. Select **Authentication** (under Manage) from the left pane.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-0529bcd95f69a3070f8673001228c6ff5c51725a%2F10.4.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Click on **Add a platform**.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-6088cda1c7b21050e33b40f9bb0e6e3756c90f7b%2F10.5.png?alt=media" alt=""><figcaption></figcaption></figure>

### Set up the redirect URI for the app

After completing the steps from the [#navigate-to-the-redirect-uris-section](#navigate-to-the-redirect-uris-section "mention"), follow the steps detailed below:&#x20;

1. Select **Single-page application** from the right-pane.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-22722d89b06d4b2f70add64ec801da9b9d9f1c1e%2F10.6.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Enter '<https://oauth.pstmn.io/v1/browser-callback>' in the **Redirect URIs** field.&#x20;
3. Under the **Implicit grant and hybrid flows** section, ensure these options are selected:
   * **Access tokens (used for implicit flows)**
   * **ID tokens (used for implicit and hybrid flows)**
4. Click on **Configure** to save the changes.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-1cd219717fc6ac84cdf537ce63c58b3ebee72fd4%2F10.7.png?alt=media" alt=""><figcaption></figcaption></figure>

### Set up the redirect URI for admins and users

You will need to add two URIs: one for admins and one for users. The URIs will be in this format: “https\://<***name***>.azurewebsites.net/”, where ***name*** will be replaced with the respective admin and user web app names. Follow the steps detailed below to first get the admin and user web app name:

1. Type “**Resource groups**" in the [Azure portal](https://portal.azure.com) search bar and select said option as it appears. &#x20;
2. Once on the page, you will see a list of resource groups displayed. Select the resource group that you have used previously (to create the managed application).
3. Find and select the managed application as shown in the image below:&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-ce6940ca55acf635f71752fe53441a52c827d63f%2F10.9.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Select **Managed resource group**.

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-84988cbd15c2b17829b27c5a15c5fb7f2172ef7e%2F11.0.png?alt=media" alt=""><figcaption></figcaption></figure>
5. An overview page will open which will display all the resources.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-3d053c7d3d0ac580259b13957737a9000fa6baa1%2F11.1.png?alt=media" alt=""><figcaption></figcaption></figure>
6. The admin web app is the one highlighted in the image below. Note down its full name.&#x20;

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: The format for the name of the admin web app for will be "<strong>admin-nameoftheapp-app</strong>", where <strong>nameoftheapp</strong> is based on the app name selected in Azure (for automatic deployment) or in the PowerShell terminal (for manual deployment).</p></div>

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-c17116f7cd744a09c9bf47d8cdfb3c0313e680ca%2F11.2.png?alt=media" alt=""><figcaption></figcaption></figure>
7. Alternatively, clicking the app's name takes you to its summary page where you can also see the admin web app name in a larger font.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-eb3ed43cec10a937cf2c346c1c2c55637d302c1f%2F11.3.png?alt=media" alt=""><figcaption></figcaption></figure>
8. Returning back to the page in step 4, you can also find the user web app as shown below. Note down its full name.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-f1adadfc62f32a49d93e70ae95e60cc9954b6a48%2F11.4.png?alt=media" alt=""><figcaption></figcaption></figure>
9. Alternatively, clicking the app's name takes you to its summary page where you can also see the user web app name in a larger font.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-01fcff83cb66135376c206973a86e88ee6822d40%2F11.5.png?alt=media" alt=""><figcaption></figcaption></figure>

After noting down the admin and user web app names, continue on from the steps in the [#navigate-to-the-redirect-uris-section](#navigate-to-the-redirect-uris-section "mention") by following the steps detailed below:&#x20;

1. Select **Web** from the right-pane.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-f22a845f3f71e8c36fafc3cd7c9f83530304e20b%2F10.8.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Enter the redirect URI for the admin web app in the **Redirect URIs** field. Click on **Configure** to save the changes.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Reminder</strong>: The admin and user web app URIs will be in this format: “https://&#x3C;<em><strong>name</strong></em>>.azurewebsites.net/”, where <em><strong>name</strong></em> will be replaced with the respective admin and user web app names.</p></div>

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-726a4268f2885bc82a927d7211ba0ab5d9825ce9%2F11.6%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>
3. Repeat the 2 previous steps and enter the redirect URI for the user web app in the **Redirect URIs** field. Click on **Configure** to save the changes.&#x20;

   <figure><img src="https://2643060172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwWVFb1sEdUq6IwVu5D2%2Fuploads%2Fgit-blob-3ebd55543748f5fd557647e12c437184be4afacb%2F11.7%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>
