live · mainnetoc · docs
specs · api · guides
docs / documentation

@orangecheck/auth-core


@orangecheck/auth-core / signSession

Function: signSession()

function signSession(
   claims: {
  addr: string;
  home_federation?: string | null;
  jti: string;
  name?: string | null;
  npub?: string | null;
  signing_method?: "fedimint_threshold" | "fedimint_client" | "bip322" | null;
  sub: string;
}, 
   cfg: SignConfig, 
ttlSeconds: number): Promise<string>;

Defined in: src/index.ts:148

Mint a fresh oc_session JWT. Only called on the auth host (the only place that holds the private key).

The caller owns persisting jti to a revocation list if they want revocation semantics — auth-core is deliberately stateless.

Parameters

ParameterType
claims&#123; addr: string; home_federation?: string | null; jti: string; name?: string | null; npub?: string | null; signing_method?: "fedimint_threshold" | "fedimint_client" | "bip322" | null; sub: string; &#125;
claims.addrstring
claims.home_federation?string | null
claims.jtistring
claims.name?string | null
claims.npub?string | null
claims.signing_method?"fedimint_threshold" | "fedimint_client" | "bip322" | null
claims.substring
cfgSignConfig
ttlSecondsnumber

Returns

Promise&lt;string>