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.
nullmeans “not authenticated”.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Grant |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request |
Request |
options |
AuthenticateOptions<Grant> |
Returns
Section titled “Returns”Promise<Authenticated<Grant>>