Validate the Live Session Token
This step closes the loop on the Live Session Token derivation process, addressing the critical gap flagged in the prior documentation: verifying that the locally computed LST matches IBKR’s own computation before it is trusted and put into use for signing future API requests.
This is a mandatory security checkpoint, not an optional integrity check. Only upon successful verification here does computed_lst become the authoritative live_session_token used for all subsequent authenticated API calls.
Compute the Verification Hash
This computes a second, independent HMAC-SHA1 operation — distinct in purpose from the HMAC used to derive the LST in the prior step:
⚠️ Purpose distinction — do not confuse these two HMAC operations:
- Derivation step (previous document): HMAC keyed by the DH shared secret (
K), over the decrypted access token secret (prepend_bytes) → produces the LST itself.- This step: HMAC keyed by the computed LST, over the consumer key → produces a verification value to confirm the LST derivation is correct.
Compare Against the Server-Provided Signature
If the locally computed hex digest matches lst_signature (returned by IBKR in the Live Session Token request response), the derivation is confirmed correct, and computed_lst is promoted to live_session_token — the value that should be used going forward for signing authenticated API requests.
🔒 This comparison is the sole gate on trusting the derived LST. A match cryptographically confirms that:
- The Diffie-Hellman shared secret
Kwas computed correctly by both parties.- The Access Token Secret was correctly decrypted (
prepend/prepend_bytes).- All byte-encoding edge cases (odd-length hex, sign-bit padding) were handled identically to IBKR’s server-side implementation.
A mismatch means any of the above may have failed, and
computed_lstmust not be used for further requests.

