Skip to content

normalizeGrant

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/ui-core/src/components/api-explorer/oauth2.ts

Turn a token response into what we keep.

RFC 6749 §5.1: an omitted scope means the grant matches what was requested — so the requested scopes are recorded rather than leaving the reader with a token of unknown reach. refresh_token is read and DROPPED here, in one place, so no caller can accidentally persist a credential that outlives the tab.

Signature

ts
function normalizeGrant(schemeId: string, raw: Record<string, unknown>, requestedScopes: string[], now): OAuth2Grant

Parameters

NameType
schemeIdstring
rawRecord<string, unknown>
requestedScopesstring[]
nowany

Returns: OAuth2Grant

Was this page helpful?

Download as PDF