iya-sts
    Preparing search index...

    The static console's runtime: sign-in, DPoP, routing and forms.

    Hierarchy (View Summary)

    Index
    • Makes the runtime.

      Parameters

      • env: any

        the browser's objects: fetch, crypto (WebCrypto), location, history, document, sessionStorage, navigator, window, and, for a test, now (milliseconds; Date.now where left out) and formDataOf (a form's FormData)

      Returns export=

    accessToken: string
    accountChannel: any
    accountKey: string
    accounts: any
    clientId: string
    elsewhere: any
    env: any
    expiresAt: number
    identity: number
    identityController: any
    key: any
    metadata: any
    nonce: string
    prefix: string
    publicJwk: any
    refreshToken: string
    scope: string
    subject: string
    CALLBACK_CHANNEL: "sts-spa-callback" = 'sts-spa-callback'
    CALLBACK_HANDOFF_MS: 1000
    SIGNIN_KEYS: string[] = ...
    • Runs the begin, browser registration and finish steps for a person.

      Parameters

      • fields: any

        the submitted user and role

      Returns Promise<void>

      nothing

    • Proves and upgrades a person's passkey from the admin console.

      Parameters

      • fields: any

        the person and classical credential id

      Returns Promise<void>

      nothing

    • Announces that this tab changed the browser's account list.

      Parameters

      • change: string

        added, signed-out, forgotten or changed

      Returns void

      nothing

    • Calls the management API.

      Parameters

      • method: string

        GET or POST

      • path: string

        the path under the realm, /admin-api/... with its query

      • Optionalbody: any

        for a POST: an object (sent as JSON) or a FormData

      Returns Promise<any>

      the response

    • Calls the management API and reads its JSON.

      Parameters

      • method: string

        GET or POST

      • path: string

        the path under the realm

      • Optionalbody: any

        for a POST, the body

      Returns Promise<any>

      the status and the JSON, or null when a sign-in began

    • The origin the management API answers on: this page's, or the API's listener's where it is on another (#472).

      Returns string

      the origin

    • Builds the console's translator from the shell's locale member, and marks the document's language and direction.

      Parameters

      • locale: any

        GET /admin-api/console's locale

      Returns void

      nothing

    • The authorization server's metadata for this realm (RFC 8414), once.

      Returns Promise<any>

      the metadata, or {} where it cannot be read

    • The authorization request's URL: pushed first where the realm requires it, the query otherwise.

      Parameters

      • params: any

        the request's parameters, client_id among them

      Returns Promise<string>

      the URL to send the browser to

    • The realm's authorization request for this client.

      Parameters

      • state: string

        the state

      • verifier: string

        the PKCE verifier

      • Optionalextra: any

        login_hint and prompt for a switch (#561), or nothing

      Returns Promise<string>

      the URL

    • Sends the browser to sign in, remembering where to come back to.

      Parameters

      • returnTo: string

        the path and query to land on after

      • Optionalextra: any

        for a switch (#561): login_hint (the account; '' for none), prompt, expect (the subject the answer must be for) and another (a sign-in as another account); nothing otherwise

      Returns Promise<void>

      nothing

    • The parameters of the authorization response this page was loaded with, from the fragment or, for a realm that offers only the query, the query.

      Returns any

      the parameters

    • Closes every open field search but the one focus moved into.

      Parameters

      • target: any

        the element that received focus

      Returns void

      nothing

    • Asks before leaving a page whose forms were typed in.

      Returns boolean

      whether to go on

    • The console path of a full path under this realm, or null for one that is not a console page.

      Parameters

      • pathname: string

        the path

      Returns string

      /admin... without the prefix, or null

    • Resolves a $ref into the OpenAPI document's components.

      Parameters

      • schema: any

        a schema, or a { $ref }

      Returns any

      the schema it names

    • Discards what this client holds for the identity that just ended: the tokens, the subject, the DPoP key and its nonce, and the metadata. A key is made again for the next sign-in, as a page load makes one.

      Returns void

      nothing

    • Discards every view this tab holds for the account it was.

      Returns void

      nothing

    • The operation path a page's ?format= link names.

      Parameters

      • page: string

        the console path

      • url: any

        the link

      • format: string

        json or svg

      Returns string

      the operation's path and query

    • Draws a body inside the console's frame.

      Parameters

      • title: string

        the page's title

      • active: string

        the console path that marks the nav

      • inner: string

        the body

      • up: any

        a drill-down's way up, or null

      • Optionalbanner: string

      Returns void

      nothing

    • Draws a page that says something went wrong, with no frame.

      Parameters

      • title: string

        what went wrong

      • detail: string

        the detail

      Returns void

      nothing

    • Draws the bar that says the session ended, over the page and leaving it as it is.

      Parameters

      • message: string

        what the last attempt came to, or ''

      Returns void

      nothing

    • Draws the page for an account the console's shell answer refused.

      Parameters

      • refusal: any

        { status, json }, what the shell answer was

      Returns void

      nothing

    • Draws the page in hand again, with what a just-finished act left.

      Parameters

      • state: any

        for the page's view: what the act answered, or null

      • Optionalbanner: string

      Returns void

      nothing

    • Ends the identity requests are sent for: every request in flight is aborted, and an answer to one sent before is not believed.

      Returns void

      nothing

    • Makes this page load's DPoP key, once.

      Returns Promise<void>

      nothing

    • Fetches what every page needs once: the shell and the form table.

      Returns Promise<boolean>

      whether they are in hand

    • Fetches an API resource with this console's token and saves it.

      Parameters

      • path: string

        the path and query under the realm, /admin-api/...

      • name: string

        the file name a download attribute gave, or ''

      Returns Promise<void>

      nothing

    • Runs a field search's Find, Previous, Next or Add and draws the result.

      Parameters

      • fields: any

        the form's fields, the pressed button's among them

      Returns Promise<void>

      nothing

    • Finishes a sign-in on the callback: checks the state, redeems the code with the verifier and a proof, and goes where the sign-in began.

      Returns Promise<void>

      nothing

    • A form's FormData — through env.formDataOf where a test hands one in.

      Parameters

      • form: any

        the form element

      Returns any

      its FormData

    • A form's fields as an object: a repeated name is an array, the pressed button's name and value are included, and the CSRF field a form drawn by the server carried is left out (an API call is not a form post).

      Parameters

      • form: any

        the form element

      • submitter: any

        the button pressed, if any

      Returns any

      the fields

    • Goes to a console path, adding it to the history.

      Parameters

      • to: string

        the path and query under the realm, /admin/...

      Returns Promise<void>

      nothing

    • Runs a group owner search's Find, Previous or Next and draws the result.

      Parameters

      • fields: any

        the form's fields, the pressed button's among them

      • Optionalholder: string

        optional; the view member holding the owners (group, or role since #604)

      • OptionalstateKey: string

        optional; the page state member (groupOwners)

      Returns Promise<void>

      nothing

    • At the callback in a popup: hands the answer to the page that opened it and closes.

      Parameters

      • query: any

        the callback's query

      Returns void

      nothing

    • Offers this callback to the tab that started the sign-in.

      A same-device wallet opens the verifier's return in a new tab. The passkey, when one is asked for, finishes there, and the authorization server then sends that tab to this callback. The PKCE record was written in the tab that called beginSignIn and never left it, so this tab cannot redeem the code. It asks that tab to load this address. The code rides only on the answer to a tab that said it holds the record. No answer within a second, and this tab finishes the refusal itself.

      Parameters

      • query: any

        the opened authorization response

      Returns Promise<boolean>

      whether a tab accepted the callback

    • The path and query being shown, without the realm prefix.

      Returns string

      /admin/...?...

    • The page's path and query with its fragment, which is the tab it is on.

      Returns string

      /admin/...?...#...

    • The login_hint a sign-in sends: what the caller names, else the tab's account, else none.

      Parameters

      • extra: any

        what the sign-in was started with: login_hint ('' for none at all, as Sign in with another account asks)

      Returns string

      the hint, or ''

    • The abort signal of the identity requests are being sent for now.

      Returns any

      the signal, or undefined where the browser has no AbortController

    • RFC 9207's iss on the authorization response, where the server sends one (ASVS 5.0.0 10.2.2): it must name this server.

      Parameters

      • query: any

        the response's parameters

      Returns Promise<boolean>

      false when the response came from somebody else

    • Keeps the tab's account, or forgets it.

      Parameters

      • account: any

        { sub, username }, or null to forget it

      Returns void

      nothing

    • Keeps the nonce a response carried, for the next proof.

      Parameters

      • res: any

        a fetch response

      Returns void

      nothing

    • Keeps the tokens a token endpoint answered with.

      Parameters

      • json: any

        the token response

      Returns void

      nothing

    • Keeps what the page holds and sends the window to sign in.

      Returns Promise<void>

      nothing

    • Listens for changes to the browser's account list, once: each change reads the list again and hands it to then, and changes nothing else.

      Parameters

      • then: (list: any) => void

        draws the menu again from the list

      Returns void

      nothing

    • Loads the scripts the page drawn names.

      Returns void

      nothing

    • Marks the open tab of every tab bar on the page just drawn.

      Returns void

      nothing

    • The operation and body a multipart form is sent as.

      Parameters

      • operation: string

        the operation's path

      • data: any

        the form's FormData, the submitter's value in it

      Returns Promise<any>

      { operation, body } for api()

    • The nonce of a sign-in whose PKCE verifier this is.

      Parameters

      • verifier: string

        the sign-in's PKCE verifier

      Returns Promise<string>

      the nonce, base64url

    • Whether an ID Token carries the nonce of the sign-in that verifier began.

      Parameters

      • idToken: any

        the compact JWT the token endpoint answered

      • verifier: string

        the sign-in's PKCE verifier

      Returns Promise<boolean>

      whether the nonce is there and is that sign-in's

    • Puts a message at the head of the page drawn.

      Parameters

      • html: string

        the message

      Returns void

      nothing

    • Follows a link in place when it is a console page of this origin.

      Parameters

      • event: any

        the click

      Returns void

      nothing

    • Records the sidebar section opened, and closes the others.

      Parameters

      • target: any

        the element a toggle event was fired at

      Returns void

      nothing

    • Redeems the code a popup's callback handed back, and lets the waiting requests go — or not, for a different person.

      Parameters

      • data: any

        { state, code, error, error_description }

      Returns Promise<void>

      nothing

    • Handles a submitted form.

      Parameters

      • event: any

        the submit event

      Returns void

      nothing

    • Parameters

      • query: any

      Returns Promise<any>

    • Opens the sign-in in a window of its own.

      Returns void

      nothing

    • Runs an owner search's Find, Previous, Next or Add and draws the result.

      Parameters

      • fields: any

        the form's fields, the pressed button's among them

      Returns Promise<void>

      nothing

    • Makes the popup's one-use values and its address: a fresh verifier and a state marked as a popup's, for the realm's own authorization request.

      Returns Promise<void>

      nothing

    • Makes a DPoP proof for one request.

      Parameters

      • method: string

        the request's method

      • url: string

        the request's URL; its query and fragment are dropped

      • accessToken: string

        the access token it is sent with, or ''

      Returns Promise<string>

      the proof

    • Calls an operation that takes no token, sending an object as JSON, and reads its JSON.

      Parameters

      • method: string

        GET or POST

      • path: string

        the path under the realm

      • Optionalbody: any

        for a POST, an object

      • Optionalheaders: any

      Returns Promise<any>

      { status, json, res }, json null where the body was not JSON

    • Random bytes, base64url.

      Parameters

      • n: number

        how many bytes

      Returns string

      the encoding

    • Reads the browser's account list, keeps it, and keeps the tab's account from it: the signed-in subject's username, or forgets the account where the list is off.

      Parameters

      • username: string

        the signed-in person's username as the application knows it, for a subject the list does not name

      Returns Promise<any>

      the list

    • Draws the account menu's items again from the list in hand, leaving the page as it is.

      Returns void

      nothing

    • Swaps the refresh token for a new pair, with a proof by the same key.

      Returns Promise<boolean>

      whether it worked

    • Takes the bar away.

      Returns void

      nothing

    • The request schema of a POST operation, from the OpenAPI document.

      Parameters

      • operation: string

        the operation's path, /admin-api/groups/create

      Returns Promise<any>

      the schema with its $ref resolved, or null

    • The management API this console's tokens are audienced to.

      Returns string

      the resource indicator

    • After a sign-in that left the page: puts back what it held, for the same realm, page and person, and says nothing was sent.

      Returns void

      nothing

    • Scrolls the sidebar so the page's active tab is in its middle.

      Returns void

      nothing

    • Draws the page the location names.

      Returns Promise<void>

      nothing

    • Saves a response the server said is a file.

      Parameters

      • res: any

        the response

      • disposition: string

        its Content-Disposition

      Returns Promise<void>

      nothing

    • Saves a file an answer carried as base64.

      Parameters

      • name: string

        its file name

      • mime: string

        its media type

      • base64: string

        its bytes

      Returns void

      nothing

    • Hands a blob to the browser as a download.

      Parameters

      • name: string

        the file's name

      • blob: Blob

        its contents

      Returns void

      nothing

    • Keeps what the page holds in sessionStorage, for after a redirect.

      Returns void

      nothing

    • Saves text as a file.

      Parameters

      • name: string

        the file's name

      • mime: string

        its media type

      • text: string

        its contents

      Returns void

      nothing

    • Calls the management API at an absolute URL — api()'s work, and what the explorer's window.stsConsoleFetch reaches.

      Parameters

      • method: string

        the method

      • target: string

        the absolute URL

      • Optionalbody: any

        an object (sent as JSON), a JSON string, a FormData, or nothing

      Returns Promise<any>

      the response, or null when a sign-in began

    • Sends one request with the tokens in hand, refreshing them where they have run out.

      Parameters

      • method: string

        the method

      • target: string

        the absolute URL

      • Optionalbody: any

        as send() takes it

      Returns Promise<any>

      the response, or NEEDS_SIGN_IN when no token will do

    • Sets the signed-in administrator's language and draws the page again in it; an empty tag follows the browser. A refusal is said on the page.

      Parameters

      • lang: string

        a tag, or ''

      Returns Promise<void>

      nothing

    • SHA-256 of a string, base64url.

      Parameters

      • text: string

        the string

      Returns Promise<string>

      the digest's encoding

    • Shapes a form's fields to an operation's request schema.

      Parameters

      • fields: any

        the form's fields

      • schema: any

        the operation's request schema, or null for none

      • Optionalunchecked: string[]

        optional; the form's unticked checkboxes' names, sent as false where the schema takes that member as a boolean

      Returns any

      the body to send

    • Waits for the person to sign in again, keeping the page.

      Returns Promise<boolean>

      true when the same person is signed in again and a waiting request may be sent; false when the window left to sign in or a different person came back

    • Signs this tab in as another account: a fresh sign-in (prompt=login) with no hint, whose account the tab then is.

      Returns Promise<void>

      nothing

    • Returns void

    • Starts the console: wires the document and draws the first page.

      Returns Promise<void>

      nothing

    • Starts collecting announcements for the realm the shell is in.

      Returns void

      nothing

    • The tab's account, where one is kept.

      Returns any

      { sub, username }, or null

    • Sends a POST form to the operation that mirrors it and draws the answer.

      Parameters

      • form: any

        the form element

      • submitter: any

        the button that submitted it, if any

      Returns Promise<void>

      nothing

    • Switches this tab to another signed-in account of the browser.

      Parameters

      • key: string

        the account's key, from the menu

      Returns Promise<void>

      nothing

    • Switches to another realm's copy of a console path.

      Parameters

      • realmId: string

        the realm

      • to: string

        the console path and query to show there

      Returns Promise<void>

      nothing

    • Makes the address's fragment the :target of the page just drawn.

      Returns void

      nothing

    • Posts a form to the token endpoint with a DPoP proof.

      Parameters

      • form: any

        the form fields

      Returns Promise<any>

      the response's JSON and status

    • This realm's address for one of its paths: on this origin, or on the listener that answers the path where the shell named one.

      Parameters

      • path: string

        /oauth2/token, /web/locales/catalogs.json

      Returns string

      the absolute URL

    • Reveals and wires the copy buttons on the page drawn.

      Returns void

      nothing

    • Wires every ordered choice's Select all switch on the page drawn.

      Returns void

      nothing

    • Wires the buttons that save the page's own view as a JSON file.

      Returns void

      nothing

    • Reads the static catalog files the shell named into the shape the translator takes. A file that cannot be had falls back to the one request that carries them all, so a page is never drawn in bare keys.

      Parameters

      • locale: any

        the shell's locale

      Returns Promise<any>

      the locale with its catalogs

    • Whether an answer is for the subject asked for: the one subject check the console's popup made first (#508) and every switch makes now (#561).

      Parameters

      • expected: string

        the subject asked for

      • idToken: any

        the ID Token the token endpoint answered

      Returns boolean

      whether its sub is that subject

    • One attribute of the shell's <html> element.

      Parameters

      • env: any

        the browser's objects

      • name: string

        the attribute, data-sts-build

      Returns string

      its value, or '' where it is absent

    • Base64url without padding.

      Parameters

      • bytes: Uint8Array

        the bytes

      Returns string

      the encoding

    • Reads the shell's data-sts-* attributes into bases by path segment.

      Parameters

      • env: any

        the browser's objects; its document is read

      • attributes: Record<string, string>

        the attribute for each first path segment

      Returns any

      the bases, without a trailing slash, '' where absent

    • A string claim of an ID Token, read without verifying it.

      Parameters

      • idToken: any

        the compact JWT, or nothing

      • name: string

        the claim

      Returns string

      its value, or ''

    • A form's fields as an object: a name that repeats is an array, as the console's own body parser reads it.

      Parameters

      • data: any

        the form's FormData

      Returns any

      the fields

    • Form-encodes parameters, a value that is an array as the parameter repeated — RFC 8707's resource, which a client asking for two resources sends twice (#607). URLSearchParams(object) would join the array with commas into one value naming no resource.

      Parameters

      • params: any

        the parameters

      Returns string

      the encoded form

    • What one form holds, as kept across a sign-in.

      Parameters

      • form: any

        the form

      • pending: boolean

        whether it is the form being sent

      Returns any

      { action, pending, fields }

    • Bytes of a base64url string.

      Parameters

      • text: string

        the encoding

      Returns Uint8Array

      the bytes

    • Whether a form control's value may be kept across a sign-in: never a password, a file, a hidden field, a button, or a control named or marked for a secret.

      Parameters

      • el: any

        the control

      Returns boolean

      true when it is kept

    • Splits a path at a surface's base: the realm prefix before it.

      Parameters

      • pathname: string

        a path, /realm/acme/portal/keys or /portal

      • base: string

        the surface's first path, /portal

      Returns string

      the prefix, '' in the default realm and where the path is not under the base

    • Splits a path at the console: the realm prefix before /admin.

      Parameters

      • pathname: string

        a path, /realm/acme/admin/users or /admin

      Returns string

      the prefix, '' in the default realm

    • Parses a query string into an object, the last value of a repeated name winning as express's own parser does for a single value.

      Parameters

      • search: string

        ?a=1&b=2 or ''

      Returns any

      the query

    • Prefixes every root-relative href, action, formaction and src.

      Parameters

      • html: string

        the page

      • prefix: string

        the realm's path prefix, or '' for the default realm

      Returns string

      the page with its links in the realm

    • Puts kept values back into the forms drawn: the same form by its place and its address, the same control by its name and order.

      Parameters

      • forms: any[]

        the forms drawn, in document order

      • saved: any[]

        formSnapshot()'s answers, in the same order

      Returns any

      { restored, unplaced }, counts of values

    • Splits every joined field (a|b = x|y) of a form into its parts (a = x, b = y), in place.

      Parameters

      • data: any

        the form's FormData

      Returns void

    • Moves a sign-in step's id from a link's query to its fragment (#1454). /authn/spnego stays: RFC 4559's exchange has no script to read one.

      Parameters

      • href: string

        the link

      Returns string

      the link to use

    • Takes a step's id off an API address, for a header (#1454).

      Parameters

      • path: string

        the operation's address

      Returns any

      the address, and the headers that carry what left it

    • The sub of an ID Token, read without verifying it.

      Parameters

      • idToken: any

        the compact JWT, or nothing

      Returns string

      the subject, or ''

    • The names of a form's checkboxes that are not ticked, where no box of that name is.

      Parameters

      • form: any

        the form element

      Returns string[]

      the names

    • WebCrypto's names for a JWS algorithm: how its key is imported and how a signature is verified, or null for one WebCrypto does not do.

      Parameters

      • alg: string

        the JWS alg

      Returns any

      { importAs, verifyAs }, or null