Share via


XUserGetTokenAndSignatureUtf16Async

API that asynchronously retrieves the X-token and Signature required to authorize an HTTPS call to the target URL. This will return an X-token and Signature if there is a Relying Party tied to the target URL in the title’s Single Sign-on page in Partner CenterAuthorization required. Add the X-token and Signature values from the Results version of the API to the Authorization and Signature headers of the HTTPS call before making the request.

Syntax

HRESULT XUserGetTokenAndSignatureUtf16Async(  
         XUserHandle user,  
         XUserGetTokenAndSignatureOptions options,  
         const wchar_t* method,  
         const wchar_t* url,  
         size_t headerCount,  
         const XUserGetTokenAndSignatureUtf16HttpHeader* headers,  
         size_t bodySize,  
         const void* bodyBuffer,  
         XAsyncBlock* async  
)  

Parameters

user   _In_
Type: XUserHandle

A handle to the user that the web request is for.

options   _In_
Type: XUserGetTokenAndSignatureOptions

Options for retrieving the user token and signature.

method   _In_z_
Type: wchar_t*

The method type for the web request, in Unicode.

url   _In_z_
Type: wchar_t*

The target URL of your HTTPS request. Use the full URL string for the HTTPS request. Don't abbreviate the URL.

headerCount   _In_
Type: size_t

The number of headers in the headers parameter.

headers   _In_reads_opt_(headerCount)
Type: XUserGetTokenAndSignatureUtf16HttpHeader*

Headers for the web request.

bodySize   _In_
Type: size_t

The size of the buffer in the bodyBuffer parameter.

bodyBuffer   _In_reads_bytes_opt_(bodySize)
Type: void*

A buffer that contains the body of the web request.

async   _Inout_
Type: XAsyncBlock*

An XAsyncBlock for polling the call's status and retrieving call results.

Return value

Type: HRESULT

Returns S_OK if successful; otherwise, returns an error code. For a list of error codes, see Error Codes.

Remarks

The XUserGetTokenAndSignatureUtf16Async function uses an XUserGetTokenAndSignatureOptions enumeration argument to asynchronously retrieve unicode X-tokens and Signatures for web requests.

To retrieve the result of calling XUserGetTokenAndSignatureUtf16Async, call XUserGetTokenAndSignatureUtf16Result.

To retrieve the required buffer size to hold the results of calling XUserGetTokenAndSignatureUtf16Async, call XUserGetTokenAndSignatureUtf16ResultSize.

Requirements

Header: XUser.h

Library: xgameruntime.lib

Supported platforms: Windows, Steam Deck, Xbox One family consoles and Xbox Series consoles

See also

XUser

XUserGetTokenAndSignatureUtf16Result

XUserGetTokenAndSignatureUtf16ResultSize