IWebAuthenticationCoreManagerInterop::RequestTokenForWindowAsync method (webauthenticationcoremanagerinterop.h)

Asynchronously requests a token from a web account provider. If necessary, the user is prompted to enter their credentials.

Syntax

HRESULT RequestTokenForWindowAsync(
  HWND         appWindow,
  IInspectable *request,
  REFIID       riid,
  void         **asyncInfo
);

Parameters

appWindow

Type: HWND

The window to be used as the owner for the window prompting the user for credentials, in case such a window becomes necessary.

request

Type: IInspectable*

The web token request, given as an instance of the WebTokenRequest class type-casted to the IInspectable interface.

riid

Type: REFIID

Must be a reference to the interface identifier (IID) for the interface IAsyncOperation<WebTokenRequestResult>. This IID is automatically generated, and you can obtain it using code like this:

using winrt::Windows::Foundation::IAsyncOperation;
using winrt::Windows::Security::Authentication::Web::Core::WebTokenRequestResult;

constexpr winrt::guid iidAsyncRequestResult{ winrt::guid_of<IAsyncOperation<WebTokenRequestResult>>() };

asyncInfo

Type: void**

The address of a pointer to IAsyncOperation<WebTokenRequestResult>. On successful return from this method, the pointer will be set to the asynchronous request operation object for the request operation just started.

Return value

Type: HRESULT

A status code for the attempt to start the asynchronous request operation.

Remarks

This method is the equivalent for desktop apps of WebAuthenticationCoreManager.RequestTokenAsync(WebTokenRequest).

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Header webauthenticationcoremanagerinterop.h

See also