Skip to content

API reference / @jsprismarine/auth / MojangKeys

Class: MojangKeys ​

Defined in: LoginVerifier.ts:60

The keys Minecraft services publishes, fetched on demand and kept for an hour, through jose's remote key set.

A token naming a key the cache lacks may mean the issuer rotated, so one fetch is allowed for it per minute; past that the answer is "unknown" without a request.

Implements ​

Constructors ​

Constructor ​

new MojangKeys(fetchKeys?): MojangKeys

Defined in: LoginVerifier.ts:64

Parameters ​

fetchKeys? ​

FetchImplementation

How the key set is fetched; the global fetch by default.

Returns ​

MojangKeys

Methods ​

keyFor() ​

keyFor(kid): Promise<VerificationKey | undefined>

Defined in: LoginVerifier.ts:74

The published key for a token's kid, fetching the set when it is stale or the id is new.

Parameters ​

kid ​

string

Returns ​

Promise<VerificationKey | undefined>

Implementation of ​

LoginKeySource.keyFor