Guide

Session credentials

An enrolled Agent can request a reusable credential when a Service offers one. Learn when that is useful, what the Service advertises, and what the Agent must manage afterward.

Why use a session credential?

The baseline way to authenticate an AEP command is a short-lived client assertion signed by the Agent. A Service may also issue a session credential after enrollment so its protected resources can use an existing API-key, Basic, or Bearer authentication system. For the Agent, this avoids signing a new assertion on every eligible resource request. The tradeoff is a reusable secret that must be stored, presented only to its issuing Service, and retired when it expires or is revoked.

A session credential is optional. A Service can use AEP without issuing one. When it does issue credentials, Grant creates them and Revoke invalidates them. Both commands always require a fresh baseline client assertion with the matching operation; an issued session credential cannot authenticate Grant or Revoke. Other AEP commands may also accept an issued credential when its grant type allows that use.

Choose a credential type

Choose among the grant types the Service advertises and the Agent can present. Each type has its own Grant response and protected-resource presentation rules; these pages show the exact fields and headers:

TypeHow it is presented
API keyThe Agent sends the issued key in the exact header named by the Grant response. AEP defines no default API-key header.
BasicThe Service issues the username and password used for HTTP Basic authentication.
OAuth BearerThe Service issues a Bearer access token through AEP Grant, not through an OAuth authorization grant.

Store and manage the credential

After a successful Grant, the Agent stores the secret with its Service DID, grant type, expiry, granted scopes when present, and Service-issued credential_id. The ID is an opaque management identifier, unique across that Service's issued credentials; it is not the secret sent to a protected resource. For an API key, the Grant response selects the presentation header; the Agent must not guess a default.

Check the returned expiry and any granted scopes before use. Requested scopes are not a promise of what the Service granted, and the absence of a scope list is not a promise that every application action is authorized. Do not send an expired credential, put a credential in logs, or carry it to another origin on a redirect. The Service still decides whether the authenticated Agent may perform each application action. If the Agent needs another credential after expiry, it calls Grant again with a new baseline assertion.

End the credential's use

An Agent should discard an expired credential locally. If a credential may have been disclosed, or access should end sooner, call Revoke using a fresh baseline assertion. The Service always supports revoking all credentials of an advertised grant type and all grant types at once. Revoking one credential_id is available only when the Service advertises supports_per_credential_revoke as "true" for that grant type. Removing a locally stored secret alone does not revoke it at the Service.