Skip to content

authenticate

function authenticate<Grant>(request, options): Promise<Authenticated<Grant>>;

Defined in: src/server/http.ts:193

Authenticate a request.

  • A Bearer <prefix>… token short-circuits the host’s provider: a valid token yields the scoped principal; an invalid or expired one throws (→ 401 through mapError). It never falls back to the host’s auth with an explicitly presented, rejected credential.
  • Otherwise the host’s provider runs. If it throws, the error propagates (→ 500): a broken identity provider is a server failure, not bad credentials. null means “not authenticated”.
Type Parameter
Grant
Parameter Type
request Request
options AuthenticateOptions<Grant>

Promise<Authenticated<Grant>>