次の方法で共有


IPassportManager3::HexPUID

IPassportManager3::HexPUID

Gets the Microsoft® .NET Passport Unique ID (PUID) for the currently authenticated user, in hexadecimal form.

Syntax

HRESULT get_HexPUID(
    BSTR *pVal
);

Parameters

  • pVal
    [out, retval] Pointer to a BSTR (not VARIANT) containing the hexadecimal-concatenated representation of the PUID for the currently connected .NET Passport user.

Return values

Returns the following value:

S_OK Success.

Remarks

This is just one approach to constructing or storing the PUID. You can use other approaches, including the use of 64-bit data types, storing as two 32-bit components, and so on. The PUID in the .NET Passport profile can be used by participating sites to identify a user's record in their user databases. The hex-concatenated approach is recommended because the resulting PUID representation is transferable across environments where 64-bit representations of data are not supported.

The sign-in name is verified by the .NET Passport domain authority, but not distributed to participating sites. Uniqueness of sign-in name will always map one-to-one with uniqueness of the PUID. Therefore, use the PUID for all unique indexing and identification on your site. The network-side unique identifier that forms the basis of the PUID is assigned at the time of registration of a new unique sign-in name and .NET Passport. Although sign-in names may potentially be recycled or even reassigned, the network-side unique identifiers (and thus the resulting PUID) are never reused.

Always call a method such as IPassportManager::IsAuthenticated or IPassportManager::get_HasTicket before calling get_HexPUID.

See Also

.NET Passport Unique ID | IPassportManager::IsAuthenticated | IPassportManager::get_HasTicket