Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Asynchronously requests a token from a web account provider. If necessary, the user is prompted to enter their credentials.
Syntax
HRESULT RequestTokenWithWebAccountForWindowAsync(
  HWND         appWindow,
  IInspectable *request,
  IInspectable *webAccount,
  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.
webAccount
Type: IInspectable*
The web account for the request, given as an instance of the WebAccount class type-casted to the IInspectable interface.
riid
Type: REFIID
Must refer 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, WebAccount).
Requirements
| Requirement | Value | 
|---|---|
| Minimum supported client | Windows 10 Build 20348 | 
| Minimum supported server | Windows 10 Build 20348 | 
| Header | webauthenticationcoremanagerinterop.h |