DoctorMcKay / node-steam-session

Node.js module for authenticating with the Steam auth server. Allows for generating refresh tokens and web auth cookies for use with steam-user and other packages.
https://www.npmjs.com/package/steam-session
MIT License
112 stars 20 forks source link

Expand custom user-agent support to also work with EAuthTokenPlatformType.MobileApp #35

Open DoctorMcKay opened 10 months ago

DoctorMcKay commented 10 months ago

Will need to likely add a constructor option that takes an object with properties:

interface ConstructorOptions {
    // ...

    mobileDeviceProperties?: MobileDeviceProperties
}

interface MobileDeviceProperties {
    mobileUserAgent?: string,     // default 'okhttp/3.12.12'
    mobileClientVersion?: string, // default '777777 3.0.0'
    deviceFriendlyName?: string,  // default 'Galaxy S22'
    osType?: number,              // default EOSType.AndroidUnknown
    gamingDeviceType?: number,    // default 528 (unknown significance)
}

Maybe we should also deprecate userAgent and rename it to webUserAgent, to differentiate it from mobileDeviceProperties.mobileUserAgent. Would also be a good idea to add a warning if webUserAgent or mobileDeviceProperties are set for inappropriate platform types.

Sadzurami commented 10 months ago

Maybe deprecate both machineId and userAgent, then add ability to pass deviceInfo instead?

deviceInfo should be one of IMobileDevice | IWebBrowser | ISteamClient, or something like for the sake of possible future updates.