Protocols/MSNP/Passport Unique ID

From NINA Wiki
Revision as of 00:23, 29 May 2020 by AD (talk | contribs) (1 revision imported)
Jump to navigation Jump to search

Passport Unique ID (PUID)

A passport account is associated with an e-mail address (which can be changed), but also an immutable and unique ID: The Passport Unique ID (PUID). This ID is not the same as the Contact ID (CID).

You can view your PUID on the Account Services page of MSN (under the "Credentials" category): https://accountservices.msn.com/uiviewpuid.srf?lc=1033&id=9.

If you're writing a Messenger client, you can retrieve this value in several ways:

Passport 3.0 (Tweener)

If your client uses Passport 3.0 to authenticate, the PUID can be found in the server's response between <psf:PUID> and </psf:PUID>. It contains 16 hexadecimal digits.

0003000083617063

If your language does not support 64 bit integers, you can split this value into two 32 bit integers (0x00030000 and 0x83617063 respectively).

Initial Member Profile

The initial member profile received from the NS also contains the PUID. The NS will send the PUID in two parts, the High and Low bit of a 64 bit integer. If you are using a language that supports 64 bit integers you can use bitshifting and bitwise-OR two contact the two fields.

MSG Hotmail Hotmail length
MemberIdHigh: 196608
MemberIdLow: -2090766237

About the PUID

The Passport Unique ID has several purposes. For example, you can store passport account related information using this ID (remember, the ID will not change even if the user changes their e-mail address, therefor their settings would automatically migrate to the new address).

The PUID is also used in notifications (Protocols/MSNP/NOT) received from the NS. You can use the PUID to verify the notification is really for the user (although it is highly unlikely you are sent a wrong Protocols/MSNP/NOT).