onelnchr-mc-auth
Version:
Package to authenticate with minecraft. Fork of minecraft-auth by dommilosz which uses my own appID by default.
24 lines (23 loc) • 1.32 kB
TypeScript
import { MCTokenResponse, MSConfigType, ServerConfigType, TokenResponse, XBLResponse, XSTSResponse } from "./MicrosoftAuth.types";
import { PKCEPairType } from "../types";
export declare function setup(_config: Partial<MSConfigType>): void;
export declare function listenForCode(_serverConfig?: Partial<ServerConfigType>): Promise<string>;
export declare function generatePKCEPair(): PKCEPairType;
export declare function createUrl(PKCEPair?: PKCEPairType): string;
export declare function getToken(authCode: string, PKCEPair?: PKCEPairType): Promise<TokenResponse>;
export declare function getTokenRefresh(refreshToken: string): Promise<TokenResponse>;
export declare function authXBL(accessToken: string): Promise<XBLResponse>;
export declare function authXSTS(xblToken: string): Promise<XSTSResponse>;
export declare function getMinecraftToken(xstsToken: string, uhs: string): Promise<MCTokenResponse>;
export declare function authFlow(authCode: string, PKCEPair?: PKCEPairType): Promise<{
access_token: string;
refresh_token: string;
}>;
export declare function authFlowRefresh(refresh_token: string): Promise<{
access_token: string;
refresh_token: string;
}>;
export declare function authFlowXBL(token: string, refresh_token: string): Promise<{
access_token: string;
refresh_token: string;
}>;