Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WsGetSecurityTokenProperty function

Extracts a field or a property from a security token. If the queried property does not use the heap parameter, the returned data is owned by the security token and remains valid as long as the security token itself remains valid. Specifically, for security tokens extracted from a received message, the security token and fields extracted from it are valid only as long as the message is not reset or freed. If the heap parameter is required by the property, then the returned data is stored on the heap, with its lifetime detached from the underlying token.


HRESULT WINAPI  WsGetSecurityTokenProperty(
  _In_     WS_SECURITY_TOKEN*            securityToken,
           void*                         value,
  _In_     ULONG                         valueSize,
  _In_opt_ WS_HEAP*                      heap,
  _In_opt_ WS_ERROR*                     error


securityToken [in]

The security token from which the property should be extracted.

id [in]

The id of the property to retrieve.


The location to store the retrieved property. The pointer must have an alignment compatible with the type of the property.

valueSize [in]

The number of bytes allocated by the caller to store the retrieved property.

heap [in, optional]

Heap to store additional property data. This parameter must be non-NULL when the queried property is WS_SECURITY_TOKEN_PROPERTY_SYMMETRIC_KEY and must be NULL otherwise.

error [in, optional]

Specifies where additional error information should be stored if the function fails.

Return value

This function can return one of these values.

Return codeDescription

The property id was not supported for this object or the specified buffer was not large enough for the value.


Ran out of memory.

Other Errors

This function may return other errors not listed above.



Minimum supported client

Windows 7 [desktop apps | UWP apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | UWP apps]









© 2018 Microsoft