Authentication Reference authentication-reference
Use this page to look up authentication fields and contracts. For the setup journey, see Authenticate end users with your own identity provider.
Authentication settings authentication-settings
Found under Settings > Authentication. Every field is stored per environment — the Workspace picker selects which one you are editing, and saving never affects the other.
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, and the iss comparison tolerates the difference — a provider that always emits a trailing slash still validates.
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 refuses unauthenticated callers. An app is fully gated only when every one of its actions is Required; a single None or Optional action makes the app mixed, because anonymous calls still succeed for at least one action.
Auth modes are only in force when Enable authentication is on. Changes take effect on the app’s next deploy.
Toggling that switch rewrites the per-action modes:
Switching Workspace never rewrites modes — it loads the other environment’s saved configuration as-is.
Enable authentication on with every action set to None is a valid but inert combination: no call is ever refused, yet the app still publishes its authorization server for discovery. Turn the switch off to make the app fully public.
Modes can be mixed freely across one app. See LLM platform behavior for how each platform applies them.
Token requirements token-requirements
Your identity provider must issue access tokens that satisfy all of the following. A token that fails any check is treated as absent — the caller is unauthenticated, and a Required action challenges them to sign in.
RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, or PS512. HMAC algorithms such as HS256 are rejectedissaudexpscope or scpsubgetAuthenticatedUserAuthorization: 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 create, host, or configure anything for it.
You must provide discovery on your own side:
/.well-known/ path. Your app reads it to locate your signing keyshttps://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
Exported from @adobe/llm-apps-runtime. Each helper takes 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 raw verified token information is on 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.
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 value is passed through to the LLM platform, which decides for itself how to word the prompt it shows the user. Send the code that accurately describes the condition rather than the one whose prompt you would prefer.LLM platform behavior platform-behavior
Support for authenticating individual actions varies by platform. Configure the same way for both; the difference is what the user experiences.