> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/academy/tier-2-core-skills/m07-governance-rbac-ai-gateway-configuration/lab-6-configure-agent-authentication-and-widget-identity.md). Agents can also search and read this documentation through its [MCP server](https://docs.uptiq.ai/~gitbook/mcp).

# Lab 6: Configure agent authentication and widget identity tokens

Hands-on lab for lesson 6 of module M07, configure agent authentication and widget identity tokens.

{% @uptiq-training/training-labels content="Module 7 | brand
Lesson 6 of 8 | brand
Lab 6 | success
13 minutes | neutral
Bloom level Apply | neutral" %}

{% @uptiq-training/training-navigator title="M07 Governance, RBAC & AI Gateway Configuration" content="Lesson 1: Understand the Platform's governance architecture and Control Center | soon
Lesson 2: Configure RBAC roles and enforce separation of duties | soon
Lab 2: Configure RBAC roles and enforce separation of duties
Lesson 3: Set up Microsoft SSO and Entra ID integration | soon
Lab 3: Set up Microsoft SSO and Entra ID integration
Lesson 4: Knowledge check 1 | soon
Lesson 5: Configure the AI Gateway for production model families | soon
Lab 5: Configure the AI Gateway for production model families
Lesson 6: Configure agent authentication and widget identity tokens | soon
Lab 6: Configure agent authentication and widget identity tokens | current
Lesson 7: Configure and validate policy-based guardrails | soon
Lab 7: Configure and validate policy-based guardrails
Lesson 8: Module assessment | soon" %}

## Lab overview

**Exercise title:** Configure Agent Authentication and Widget Identity Tokens

**Difficulty level:** Apply (Bloom Level 3 — you will configure a real feature in the sandbox, not just describe it)

**Estimated hands-on time:** 13 minutes (9 minutes hands-on practice, 2 minutes concept check, 2 minutes orientation)

**What you will build:** You will configure the Authentication tab on a sandbox agent to require Microsoft Entra ID verification for agent callers, review the Access & Security page to confirm the Widget Key and Allowed Domains settings, and orient yourself to the Setup Identity Token feature for testing authenticated agent calls in the widget.

**Enabling objective:** Configure agent Authentication tab settings to require Microsoft Entra ID or Google sign-in for agent callers, and configure embedded widget identity tokens (Setup Identity Token) for end-user sign-in in a deployed widget.

### Prerequisites

* You have completed the M03 borrower onboarding agent lab, or your instructor has provisioned an equivalent sandbox agent for you to use.
* You have Developer, Account Admin, or Org Admin access in the sandbox (required to open Agent Config).
* You understand the difference between platform SSO (how users sign in to the Uptiq Platform) and agent Authentication (how the agent verifies its callers). If you are unsure, review the callout at the start of Procedure 1 before you begin.

## Your sandbox environment

**Environment access URL:** `<provided by your instructor>`

### Connection details you will need during this lab

| Field                                                                      | Where to find it                                                                                    |
| -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **Sandbox agent name**                                                     | Your instructor will confirm which agent to open — typically the borrower onboarding agent from M03 |
| **Microsoft Entra ID test token (for Setup Identity Token, if available)** | `<provided by your instructor>`                                                                     |

### Pre-provisioned resources — no action required

The following are already set up in your sandbox. You do not need to create or configure them before starting:

* A sandbox agent (the borrower onboarding agent from M03, or an equivalent agent your instructor has provisioned)
* Your sandbox user account with the appropriate role to access Agent Config
* The Embedded Chat widget key (you will review this in Procedure 2, not create it from scratch)

{% hint style="info" %}
**Tip:** Agent Authentication is configured per agent, inside Agent Builder. It is not a platform-wide setting. If you open the wrong agent, you will configure Authentication on the wrong resource. Confirm the agent name with your instructor before you begin.
{% endhint %}

## Configuration template

{% hint style="warning" %}
The Authentication tab configuration for this lab targets Microsoft Entra ID as the identity provider. The exact field names and form layout are subject to SME verification (PKB Gap G4); the values below reflect what the source documentation confirms.
{% endhint %}

{% hint style="danger" %}
**Warning:** The step-by-step field layout of the Authentication tab has not been fully verified against the live UI (PKB Gap G4). Your instructor will walk you through any fields that differ from what is described here. Do not skip the Authentication tab configuration — work through it with your instructor's guidance if the UI differs.
{% endhint %}

### Authentication tab — target configuration

| Field                      | Value              | Notes                                                   |
| -------------------------- | ------------------ | ------------------------------------------------------- |
| **Authentication enabled** | On (toggled on)    | The toggle must be on before provider selection appears |
| **Identity provider**      | Microsoft Entra ID | Select from the available provider options              |

### Access & Security page — review only (no changes required)

| Field               | Expected state                       | Notes                                                            |
| ------------------- | ------------------------------------ | ---------------------------------------------------------------- |
| **Widget Key**      | Present (a key value is displayed)   | Do not change or regenerate — review only                        |
| **Allowed Domains** | At least one domain listed, or empty | An empty list means the widget runs nowhere outside the platform |

## Step-by-step instructions

### Procedure 1 — Distinguish Authentication from SSO

Before you touch the UI, take two minutes to anchor the critical distinction this lab depends on. Confusing these two concepts is the most common mistake learners make in this lesson.

{% hint style="info" %}
**Concept:** There are two separate authentication concepts in the Platform, and they live in completely different places.

Single Sign-On (SSO) is how people sign in to the Platform itself. It is configured in `Control Center > Admin > Single Sign-On`. When SSO is enabled, users see a "Continue with Microsoft" or "Continue with Google" button on the login page.

Agent Authentication is how the agent verifies the identity of whoever is calling it. It is configured in `Agent Config > Authentication` inside Agent Builder — a completely separate page from SSO. When Authentication is enabled on an agent, the agent checks the caller's Microsoft Entra ID or Google token before running.

These two features are independent. Enabling SSO does not enable agent Authentication, and vice versa. In this lab you are configuring agent Authentication — you are not touching the SSO page.
{% endhint %}

{% hint style="info" %}
**Concept:** When agent Authentication is enabled, three things happen depending on what the caller presents:

* **Valid token presented:** The token is verified. It becomes available to the agent's MCP connections as `$auth.token`, so downstream tools can apply the caller's permissions and maintain an audit trail.
* **No token presented:** The request still runs. `$auth.token` is simply unavailable to MCP connections.
* **Invalid token presented:** The request is rejected.

This means Authentication does not block unauthenticated callers — it enriches authenticated ones and rejects invalid ones. Keep this in mind when you reach the concept check.
{% endhint %}

#### Step 1 — Confirm your understanding before proceeding

Read both concept callouts above. If anything is unclear, raise your hand before moving to Procedure 2.

### Procedure 2 — Open the Agent and Navigate to the Authentication Tab

{% stepper %}
{% step %}
**Open your sandbox agent in Agent Builder**

Navigate to Agent Builder and open the borrower onboarding agent (or the agent your instructor has assigned). Confirm you are in the correct agent before proceeding.

*Agent Builder canvas open, showing the borrower onboarding agent with the top toolbar visible and the agent name confirmed*

{% hint style="info" %}
**Checkpoint:** Confirm the agent name in the top toolbar matches the agent your instructor assigned. If you see a different agent, close this one and open the correct agent before continuing.
{% endhint %}
{% endstep %}

{% step %}
**Navigate to Agent Config → Authentication**

In Agent Builder, open `Agent Config` and select `Authentication`.

{% hint style="danger" %}
**Warning:** The Authentication tab is inside Agent Config, which is part of Agent Builder. It is not in Control Center. If you find yourself in `Control Center > Admin > Single Sign-On`, you are in the wrong place — that is the platform SSO page, not agent Authentication. Navigate back to Agent Builder.
{% endhint %}

*Agent Config Authentication tab open, showing the identity provider options (Microsoft Entra ID and Google) with the Authentication toggle in the off state*

{% hint style="info" %}
**Checkpoint:** You should see the Authentication tab with at least two identity provider options: Microsoft Entra ID and Google. If you see only SSO-related settings or a page about user sign-in, you are on the wrong page.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 3 — Configure Microsoft Entra ID Authentication

{% hint style="danger" %}
**Warning:** The exact field names and layout of the Authentication tab are pending SME verification (PKB Gap G4). The steps below describe the expected configuration flow based on available documentation. If your UI differs, work through the configuration with your instructor's guidance — do not skip this procedure.
{% endhint %}

{% stepper %}
{% step %}
**Enable Authentication**

On the Authentication tab, turn on the Authentication toggle.

You should see the identity provider selection become available after the toggle is on.

{% hint style="info" %}
**Checkpoint:** The toggle should show as enabled (on). If the provider selection does not appear after toggling, wait a moment for the UI to update, then refresh if needed.
{% endhint %}
{% endstep %}

{% step %}
**Select Microsoft Entra ID as the identity provider**

*Authentication tab with Microsoft Entra ID selected as the identity provider and the configuration fields visible*

{% hint style="info" %}
**Tip:** The two supported identity providers for agent Authentication are Microsoft Entra ID and Google. You are selecting which token type the agent will verify. In this lab you are selecting Microsoft Entra ID. A caller presenting a valid Entra ID token will have that token available as `$auth.token` to the agent's MCP connections.
{% endhint %}
{% endstep %}

{% step %}
**Save the Authentication configuration**

Save your changes on the Authentication tab. The exact save action (button label and location) will match your sandbox UI.

{% hint style="info" %}
**Checkpoint:** After saving, confirm that Authentication shows as enabled with Microsoft Entra ID as the selected provider. If the save fails or the configuration reverts, check that you have the required role (Developer, Account Admin, or Org Admin) and try again.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 4 — Review Access & Security

Authentication identifies the caller. Access & Security authorizes the calling application. You will review — not change — the Access & Security page to understand how these two pages work together.

{% stepper %}
{% step %}
**Navigate to Agent Config → Access & Security**

In Agent Builder, open `Agent Config` and select `Access & Security`.

*Access & Security page showing the Widget Key field and the Allowed Domains list*
{% endstep %}

{% step %}
**Confirm the Widget Key is present**

On the Access & Security page, locate the Widget Key field. Confirm that a key value is displayed.

{% hint style="info" %}
**Concept:** The Widget Key is required for the Embedded Chat widget. It is safe to ship in browser code because it only works from the Platform itself and from domains on the Allowed Domains list. A request using the Widget Key from an origin not on the Allowed Domains list is refused.
{% endhint %}

{% hint style="info" %}
**Checkpoint:** You should see a Widget Key value on the page. If no key is present, your instructor will advise — do not generate a new key unless instructed to do so.
{% endhint %}
{% endstep %}

{% step %}
**Review the Allowed Domains list**

On the same page, locate the Allowed Domains list. Note whether any domains are listed.

{% hint style="info" %}
**Concept:** The Allowed Domains list controls which web origins the agent's embedded widget may run on. If the list is empty, the widget runs nowhere outside the Platform itself. For a production deployment, your organization's domain would be added here.
{% endhint %}

{% hint style="info" %}
**Checkpoint:** Note the current state of the Allowed Domains list (empty or populated). You do not need to add or remove domains in this lab — this is a review step.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 5 — Orient to Setup Identity Token

Setup Identity Token is a developer testing feature that lets you try an agent as a specific signed-in person by pasting their token. It appears under Developer Mode in the agent's Try Agent panel.

{% hint style="danger" %}
**Warning:** Setup Identity Token is marked "Available on request" in the platform documentation (PKB Gap G5). Whether it is available in your sandbox depends on your environment. Your instructor will confirm availability before you begin this procedure. If it is not available, complete Steps 1–2 as an orientation and proceed to the concept check.
{% endhint %}

{% stepper %}
{% step %}
**Open the Try Agent panel and access Developer Mode**

In Agent Builder, open the Try Agent panel (the chat panel used to test the agent). Open the chat menu and turn on Developer Mode.

*Try Agent chat menu open with Developer Mode toggled on*

{% hint style="info" %}
**Tip:** Developer Mode exposes additional testing options in the Try Agent panel, including Setup Identity Token. It is a testing-only feature — it does not affect how the agent behaves for end users in production.
{% endhint %}
{% endstep %}

{% step %}
**Locate the Setup Identity Token option**

With Developer Mode on, look for the Setup Identity Token option in the Try Agent panel.

*Setup Identity Token dialog open in the Try Agent panel, showing the token paste field*

{% hint style="info" %}
**Concept:** Setup Identity Token lets you paste a real user's Microsoft Entra ID or Google token into the widget so you can test the agent as that specific signed-in person. This is how you verify that `$auth.token` is being passed correctly to your MCP connections during development — you simulate a real authenticated caller without deploying the agent to production.
{% endhint %}
{% endstep %}

{% step %}
**If available, paste the test token and observe the agent run**

If Setup Identity Token is available in your sandbox and your instructor has provided a test token, paste the token into the Setup Identity Token field and run a test query. Observe that the agent runs as the signed-in person represented by the token.

If Setup Identity Token is not available in your sandbox, proceed to Section 6 (Checkpoints and Validation).

{% hint style="info" %}
**Checkpoint:** If you completed the token test, confirm that the agent ran without an authentication error. If you received a rejection, confirm that the token your instructor provided is valid and has not expired.
{% endhint %}
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>Fixes for common problems in this lab</summary>

| Symptom                                                                                                                          | Cause                                                                                                 | Fix                                                                                                                                                              |
| -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **You are on a page showing SSO settings (Microsoft tenant ID, client ID, redirect URI) instead of identity provider selection** | You navigated to `Control Center > Admin > Single Sign-On` instead of `Agent Config > Authentication` | Close Control Center. Open Agent Builder, open your agent, go to `Agent Config > Authentication`. These are two different pages.                                 |
| **The identity provider selection does not appear after toggling Authentication on**                                             | The UI may need a moment to update after the toggle                                                   | Wait 2–3 seconds. If the provider options still do not appear, refresh the page and toggle Authentication on again.                                              |
| **Save fails on the Authentication tab**                                                                                         | Insufficient role permissions                                                                         | Confirm you have Developer, Account Admin, or Org Admin access. Contact your instructor if your role is incorrect.                                               |
| **Widget Key is not present on the Access & Security page**                                                                      | The key has not been generated for this agent                                                         | Do not generate a new key without instructor guidance — this is a review step. Notify your instructor.                                                           |
| **Setup Identity Token option does not appear in Developer Mode**                                                                | Setup Identity Token is "Available on request" and may not be enabled in your sandbox                 | This is expected if your sandbox does not have the feature enabled. Proceed to the concept check. Your instructor will confirm whether the feature is available. |
| **Agent rejects a request during the Setup Identity Token test**                                                                 | The test token is invalid or expired                                                                  | Confirm the token your instructor provided is current. Entra ID tokens expire; a new token may be needed.                                                        |
| **You see a request run but `$auth.token` is unavailable to MCP connections**                                                    | The caller submitted the request without a token                                                      | This is expected behavior — requests without a token still run, but `$auth.token` is not populated. Only requests with a valid token populate `$auth.token`.     |

</details>

## Checkpoints and validation

### Embedded Checkpoints

#### Checkpoint A — Authentication tab configured

Confirm that the Authentication tab on your sandbox agent shows Authentication enabled with Microsoft Entra ID selected as the identity provider. If Authentication is off or a different provider is selected, return to Procedure 3 and complete the configuration.

#### Checkpoint B — Access & Security reviewed

Confirm that you have viewed the Access & Security page and noted the state of the Widget Key and Allowed Domains list. You do not need to have changed anything — this is a review checkpoint.

#### Checkpoint C — Setup Identity Token orientation complete

Confirm that you have located the Setup Identity Token option in Developer Mode (or confirmed with your instructor that it is not available in your sandbox). If it was available and you completed the token test, confirm the agent ran without an authentication error.

### Summative Assessment

#### Item 1 (EO-7.4, Apply)

A bank deploys an agent with Authentication enabled. A caller submits a request without a token. What happens?

* A. The request is rejected because Authentication is enabled and requires a token.
* B. The request runs, but `$auth.token` is unavailable to MCP connections.
* C. The agent prompts the caller to sign in before the run continues.
* D. The request runs with a default token supplied by the platform.

<details>

<summary>Answer</summary>

**Correct answer:** B

**Why:** Authentication does not require a token to be present. Requests without a token still run — `$auth.token` is simply unavailable to MCP connections for that run. Only requests with an *invalid* token are rejected. This is a critical distinction: Authentication enriches authenticated callers and rejects invalid ones, but it does not block unauthenticated callers.

**Enabling objective:** EO-7.4

</details>

#### Item 2 (EO-7.4, Apply)

You need to configure an agent so that only Microsoft Entra ID users can call it and their identity is passed to downstream MCP tools. Where do you configure this?

* A. `Control Center > Admin > Single Sign-On`
* B. `Agent Config > Authentication > select Microsoft Entra ID`
* C. `Agent Config > Access & Security > Widget Key`
* D. `Control Center > AI Gateway > Gateway Settings`

<details>

<summary>Answer</summary>

**Correct answer:** B

**Why:** Agent Authentication — the feature that verifies a caller's Entra ID token and makes it available as `$auth.token` to MCP connections — is configured in `Agent Config > Authentication` inside Agent Builder. Option A is the platform SSO page (how users sign in to the Platform, not how agents verify callers). Option C is the Access & Security page, which manages the Widget Key and Allowed Domains but does not configure identity provider verification. Option D is the AI Gateway, which governs model routing and has nothing to do with caller identity.

**Enabling objective:** EO-7.4

</details>

## Solution reference

<details>

<summary>The completed state of your work</summary>

The following describes the completed state of your sandbox agent after all procedures are successfully executed.

### Authentication tab — completed state

| Field                 | Value                |
| --------------------- | -------------------- |
| **Authentication**    | Enabled (toggled on) |
| **Identity provider** | Microsoft Entra ID   |

When a caller presents a valid Microsoft Entra ID token to this agent, the token is verified and made available as `$auth.token` to the agent's MCP connections. A caller without a token can still run the agent, but `$auth.token` will be unavailable. A caller with an invalid token is rejected.

### Access & Security page — reviewed state

| Field               | State                                                                  |
| ------------------- | ---------------------------------------------------------------------- |
| **Widget Key**      | Present (pre-provisioned in sandbox)                                   |
| **Allowed Domains** | As configured in your sandbox (empty or populated with sandbox domain) |

The Widget Key is safe to ship in browser code because it only works from the Platform and from origins on the Allowed Domains list. Authentication (which verifies the caller's identity) and Access & Security (which authorizes the calling application) work together — they are separate pages with complementary roles.

### Setup Identity Token — orientation state

Setup Identity Token appears under Developer Mode in the Try Agent panel. When available, it allows a developer to paste a real user's Entra ID or Google token to test the agent as that specific signed-in person. This is a development-time testing feature, not a production configuration. It is marked "Available on request" and may not be present in all sandbox environments.

{% hint style="danger" %}
**Warning:** The exact field layout of the Authentication tab configuration (Step 3 of Procedure 3) is pending SME verification (PKB Gap G4). If your sandbox UI differed from the steps described, your instructor will have guided you through the correct fields. The conceptual behavior described in this solution reference — how `$auth.token` works, what happens with no token vs. an invalid token, and how Authentication and Access & Security relate — is fully verified against the platform documentation.
{% endhint %}

</details>

{% hint style="success" %}
**Lab complete.** Confirm every checkpoint above before you move on.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uptiq.ai/academy/tier-2-core-skills/m07-governance-rbac-ai-gateway-configuration/lab-6-configure-agent-authentication-and-widget-identity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
