XGameUiShowWebAuthenticationWithOptionsAsync
Begins the asynchronous authentication request that displays a web UI, possibly full screen, that allows the user to delegate access to external web sites and services without directly providing their credentials to the running title.Syntax
Parameters
async _In_Type: XAsyncBlock* A pointer to the XAsyncBlock that is passed to XAsyncRun. requestingUser _In_
Type: XUserHandle A handle to the user requesting the web authentication. requestUri _In_z_
Type: char* The initial URI of the web view presented to the user (likely containing fields for user authentication to the service). The request URI must be a secure HTTPS address. completionUri _In_z_
Type: char* Indicates the URI that represents successful completion of the web authentication process. When the web view is navigated to a uri that matches the completionUri, the web view is closed, and control is returned to the calling title. options &nbps; _In_ Type: XGameUiWebAuthenticationOptions Flag indicating whether or not try and show the UI full screen or not. On PC, this flag is ignored. Full screen is not an option that is supported on PC.
Return value
Type: HRESULT HRESULT success or error code of the async call. To get the result, call xgameuishowwebauthenticationresultsize and xgameuishowwebauthenticationresult inside the AsyncBlock callback or after the AsyncBlock is complete.Remarks
When this asynchronous task runs, the system presents a web view to the user (overlaying the current application), which they can interact with or dismiss by pressing back. This allows users to use OAuth in order to grant authorization permission to external web sites and services. This can be used in scenarios such as authenticating the game to share in-game highlights on social media, requesting user data from external providers, and more. The result of the authentication request is stored in the XGameUiWebAuthenticationResultData object which is returned from the XGameUiShowWebAuthenticationResult method. If the web view is closed as a result of navigating to the completionUri, then the responseStatus field of the result data structure will beS_OK.
If the user cancels or otherwise manually closes the web view, then the responseStatus field of the result data structure will be E_CANCELLED.
Example
The following code example shows how to perform OAuth by using Facebook. This example does not include memory allocation error handling in order to keep the code brief.Requirements
Header: XGameUI.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consolesSee also
XGameUI XGameUiShowWebAuthenticationAsyncXGameUiShowWebAuthenticationResultSize
XGameUiShowWebAuthenticationResult
XGameUiWebAuthenticationResultData
Asynchronous Programming Model
