Authentication reference authentication-reference
Use this page to look up authentication fields and contracts. For setup instructions, see Authenticate end users with your own identity provider.
Authentication settings authentication-settings
Open Settings > Authentication. Each environment stores its own settings. Use the Workspace picker to select the environment to edit; saving settings never affects the other environment.
iss claim. Must be HTTPS. Also published as this app’s authorization server. One identity provider per appValidation rules
offline_access is listed in Scopes supported or on an actionoffline_access requests a refresh token from your authorization server rather than granting access to this app, so it is not a scope this app advertises. You do not need to list it — the LLM platform requests it from your authorization server directlyTrailing slashes on Issuer are normalized. The iss comparison tolerates the difference, so tokens from a provider that always includes a trailing slash still validate.
Auth modes auth-modes
Set per action under Per-action configuration.
noauthoauth2noauth and oauth2A Required action’s handler never runs without a valid, correctly scoped token. An Optional action’s handler always runs and may request sign-in itself with extra.challengeAuth().
Required is therefore the only mode that rejects unauthenticated callers. An app rejects all anonymous calls only when every action is Required. If any action is None or Optional, the app uses mixed authentication because at least one action accepts anonymous calls.
Auth modes take effect only when Enable authentication is on. Changes take effect on the app’s next deployment.
Changing the authentication switch also rewrites the per-action modes:
Switching Workspace never rewrites modes. The picker loads the other environment’s saved configuration without changing it.
With Enable authentication on and every action set to None, the app does not require authentication but still publishes its authorization server for discovery. To make the app fully public, turn the switch off.
An app can use different auth modes for individual actions. See LLM platform behavior for how each platform applies them.
Token requirements token-requirements
Your identity provider must issue access tokens that meet all the following requirements. The runtime treats a token that fails any check as absent: the caller is unauthenticated, and a Required action challenges the caller to sign in.
RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, or PS512. HMAC algorithms such as HS256 are rejectedissaudexpscope or scpscope string, or falls back to an array of strings in scp. Use one of these shapes for scopes checked against each action’s requirementssubgetAuthenticatedUserAuthorization: Bearer <token> request headerAny additional flat claims your provider includes — for example tenant or email — are passed through to your handler. Nested objects are dropped, and long string values are truncated.
Identity provider discovery discovery
Your app publishes its own RFC 9728 protected resource metadata so LLM platforms can locate your authorization server. You do not need to create, host, or configure the protected resource metadata.
Your identity provider must provide the following discovery information:
jwks_uri; it does not fall back to the OIDC discovery pathhttps://auth.example.com/oauth2/default serves its metadata at https://auth.example.com/.well-known/oauth-authorization-server/oauth2/defaultHandler auth API handler-auth-api
The package @adobe/llm-apps-runtime exports the following helpers. Each helper accepts extra, the second argument your handler receives.
getAuthenticatedUser(extra)sub claim, or undefined when the call is unauthenticatedhasScope(extra, scope)true when the caller’s token carries scopeThe verified token information is available in extra.authInfo, which is undefined for an unauthenticated call.
authInfo.tokenauthInfo.clientIdclient_id or azp claim, or unknownauthInfo.scopesauthInfo.expiresAtexp claimauthInfo.resourceauthInfo.extrasub plus any other flat claims your identity provider includedextra.challengeAuth(options) is available only on Optional actions. Return its result from your handler to ask the user to sign in instead of returning content.
The helper returns a tool-result challenge for ChatGPT. Claude requires a transport-level HTTP challenge. The runtime supplies that challenge for Required actions, but not through the optional-handler helper.
errorinvalid_token, insufficient_scope, or invalid_request. Defaults to insufficient_scopeerrorDescriptionscopeerror explicitly. Use invalid_token for a caller with no valid session, and insufficient_scope only for a caller whose token is valid but lacks a required scope. The runtime passes the value to the LLM platform, which chooses the wording of the sign-in prompt. Send the code that accurately describes the condition rather than the code with your preferred prompt.LLM platform behavior platform-behavior
Both platforms support public and protected actions in the same app, but their sign-in triggers differ.
extra.challengeAuth()See Claude lazy authentication and ChatGPT authentication for current client behavior. Connector UI and policy can vary by account and organization.