gnap-caep-client
    Preparing search index...

    Class GrantSet

    What a GNAP grant gave this client: one access token, how to manage it, how to continue the grant, and who the resource owner is. Serializable with toJSON() / GrantSet.from().

    The access token is bound to the client key (it is presented as Authorization: GNAP <value> with an HTTP message signature) unless bearer is true.

    Index
    • Parameters

      • fields: Record<string, any>

        Snake-case fields, optionally with expires_in (seconds).

      • Optionalclaims: Record<string, any>

        The validated identity of the resource owner.

      Returns GrantSet

    access: (string | Record<string, any>)[] | undefined

    The access rights the token carries (RFC 9635 section 8).

    access_token: string

    The access token's value.

    bearer: boolean | undefined

    The token was issued with the bearer flag: no key proof is sent with it.

    claims: Record<string, any> | undefined

    Who the resource owner is, as this client validated it: iss and sub from an iss_sub subject identifier (or an opaque one, with the grant endpoint as iss), uid (their username) and account from an account one, and the profile claims of an id_token assertion when one was verified.

    continue:
        | { access_token: { value: string }; uri: string; wait?: number }
        | undefined

    Continuation (section 5): { uri, access_token: { value }, wait? }.

    expires_at: number | undefined

    Epoch seconds when the access token expires.

    flags: string[] | undefined

    The access token's flags (RFC 9635 section 3.2.1).

    grant_endpoint: string | undefined

    The grant endpoint that issued it.

    grant_id: string | undefined

    The grant's id: the last path segment of the continuation URI.

    instance_id: string | undefined

    The instance_id the AS handed this client instance (section 3.5), if any.

    issued_at: number | undefined

    Epoch seconds when the access token was issued.

    key_thumbprint: string | undefined

    The thumbprint of the client key the token is bound to.

    label: string | undefined

    The token's label, when a multiple-token request named one.

    manage: { access_token: { value: string }; uri: string } | undefined

    Token management (section 6): { uri, access_token: { value } }.

    subject: Record<string, any> | undefined

    The subject information as the AS returned it: sub_ids, assertions, updated_at.

    token_type: string

    Always "GNAP": the Authorization scheme the token is presented with.

    • Skew to apply for early rotation, capped at half the token lifetime so short-lived tokens aren't considered expired the moment they're issued.

      Parameters

      • skewSec: number

      Returns number

    • The session ids iya-sts names this grant by in a CAEP session-revoked: gnap-grant:<grant id>, and gnap-token:<jti> when the access token is a JWT. The jti is read from the token without verifying it; it is only ever compared with the session named in a SET whose signature was verified.

      Returns string[]