Authentication
Verify agent callers through your identity provider and pass their identity to MCP connections.
Authentication verifies a caller's Microsoft Entra ID or Google token before an agent run. Verified tokens are available to MCP connections as $auth.token, so downstream tools can apply the caller's permissions and audit trail.
Use Authentication with Access & Security.
Authentication identifies the person.
Access & Security authorizes the calling application.
Authentication does not require a token. Requests without one still run, but $auth.token is unavailable. Requests with an invalid token are rejected.
Configure authentication
Register an application with your identity provider before you begin:
Microsoft Entra ID — Register an application in your Entra directory.
Google — Create an OAuth client in your Google Cloud project.
Enter provider details
Enter the required identifiers. See provider requirements.
Turning Authentication off retains your provider details. The agent does not use them until you enable Authentication again.
Provider requirements

Directory (tenant) ID
The Overview page for the Entra app registration.
Application (client) ID
The same Overview page.
Qore accepts a token only when it is:
Signed by your Entra directory.
Issued by that directory's v2.0 endpoint.
Intended for the configured application client ID.

OAuth client ID
The OAuth client in your Google Cloud project. It ends in .apps.googleusercontent.com.
Send the Google OAuth access token from the user's sign-in. Qore verifies that Google issued it for the configured OAuth client ID.
Send the caller token
Send the caller's token with every agent request. Qore verifies it and exposes it to MCP connections as $auth.token.
Add token beside message in the trigger request body.
Pass the signed-in user's token using authToken in React or auth-token in HTML.
The widget sends it with new chats, follow-up turns, and permission or credential requests. A headless instance supports setAuthToken() for refreshed tokens.
Setup Identity Token
Available on request. Setup Identity Token is switched on only for the clients who have asked for it. If your widget doesn't show Developer Mode, it isn't enabled for you.
Setup Identity Token lets you try an agent as a specific signed-in person by pasting their token by hand. When a widget is created with allowDeveloperMode, its sidebar shows a Developer Mode switch. Switch it on and, for an agent with authentication enabled, a Setup Identity Token action appears under Start New Chat. Paste a token there to try the agent as that person.
The token lasts for the session and is never stored.
A token passed as
authTokenreplaces one entered by hand.In the Agent Playground, Developer Mode is not available in production.
Use the token in MCP connections
Reference $auth.token in an MCP connection configuration where the downstream server expects a user credential. Qore replaces it with the verified token during the run.
$auth.tokenworks only in MCP connection configurations. Skills and agent instructions cannot access it.
Use $auth.token like the $secret. and $agent. values described in Secrets & Variables. Ensure every caller sends a token when the downstream system requires a signed-in user.
Request outcomes and token security
Off
Any, or none
The run proceeds. Qore ignores the token.
On
None
The run proceeds without $auth.token.
On
Valid
The run proceeds. $auth.token contains the token.
On
Invalid, or issued for another application or client
Rejected with AGENT_AUTHENTICATION_FAILED.
On
Expired Microsoft Entra ID token
Rejected with TOKEN_EXPIRED.
On
Expired Google token
Rejected with AGENT_AUTHENTICATION_FAILED. Google reports expired and invalid tokens identically.
On, with incomplete provider details
Any token
Rejected with AGENT_AUTHENTICATION_CONFIG_INVALID. Update the agent configuration.
On, when Google is unavailable
Any token
Fails with GOOGLE_IDENTITY_SERVICE_UNAVAILABLE and HTTP 503. Retry the request.
If Microsoft Entra ID is unavailable, Qore rejects the request with AGENT_AUTHENTICATION_FAILED.
Token security
Qore encrypts the token before queuing the run.
Qore decrypts it only to verify the token.
Qore never stores the raw token.
Execution-status responses exclude the raw token.
The embedded widget keeps the token only in session memory.
Send tokens only from your application's authenticated session. Do not accept tokens from URLs, form fields, or other user-controlled inputs.
Maintained by Abhishek Paul
AI-assisted, human-approved

Last updated
Was this helpful?

