Class iCloudAuthenticationStore

Hierarchy

  • iCloudAuthenticationStore

Constructors

Properties

_log: ((level: number, ...args: any[]) => void)

Type declaration

    • (level: number, ...args: any[]): void
    • Parameters

      • level: number
      • Rest ...args: any[]

      Returns void

aasp?: string
icloudCookies: Cookie[]

The options provided to the iCloudService that owns this AuthenticationStore

scnt?: string
sessionId?: string
sessionToken?: string
tknFile: string

The exact file path to the base file name of the trust token file.

Default

"~/.icloud/.trust-token"

Remarks

The actual file name will be tknFile + "-" + base64(lowercase(username))

trustToken?: string

Methods

  • Parses a list of cookies and adds them to the authenticationStore's icloudCookies property.

    Parameters

    • cookies: string[]

      A list of cookies to add in the format of a Set-Cookie header.

    Returns void

  • Returns {
        Accept: string;
        Content-Type: string;
        Cookie: string;
        Origin: string;
        User-Agent: string;
    }

    • Accept: string
    • Content-Type: string
    • Cookie: string
    • Origin: string
    • User-Agent: string
  • Returns {
        Accept: string;
        Content-Type: string;
        Cookie: string;
        Origin: string;
        Referer: string;
        User-Agent: string;
        X-Apple-I-FD-Client-Info: string;
        X-Apple-ID-Session-Id: string;
        X-Apple-OAuth-Client-Id: string;
        X-Apple-OAuth-Client-Type: string;
        X-Apple-OAuth-Response-Mode: string;
        X-Apple-OAuth-Response-Type: string;
        X-Apple-Widget-Key: string;
        scnt: string;
    }

    • Accept: string
    • Content-Type: string
    • Cookie: string
    • Origin: string
    • Referer: string
    • User-Agent: string
    • X-Apple-I-FD-Client-Info: string
    • X-Apple-ID-Session-Id: string
    • X-Apple-OAuth-Client-Id: string
    • X-Apple-OAuth-Client-Type: string
    • X-Apple-OAuth-Response-Mode: string
    • X-Apple-OAuth-Response-Type: string
    • X-Apple-Widget-Key: string
    • scnt: string
  • Loads a trust token from disk

    Parameters

    • account: string

      The account to load the trust token for

    Returns void

  • Sets this authenticationStore's trustToken and sessionToken properties. Also writes the trust token to disk.

    Returns

    Parameters

    • account: string

      Username of the account

    • trustResponse: Response

      Response to the 2sv/trust request.

    Returns string

  • Processes a successful iCloud sign in response. Sets this authenticationStore's sessionId, sessionToken, scnt, and aasp properties.

    Returns

    True if the secrets are all present, false otherwise.

    Parameters

    • authResponse: Response

      The response from the sign in request

    Returns string | false

  • Parses cookies from a response and adds them to the authenticationStore's icloudCookies property.

    Returns

    True if cookies were found, false otherwise.

    Parameters

    • cloudSetupResponse: Response

      The response from the iCloud setup request

    Returns boolean

  • Writes a trust token to disk

    Parameters

    • account: string

      The account to write the trust token for

    Returns void

Generated using TypeDoc