Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Notifies Remote Desktop Gateway (RD Gateway) about the result of an attempt to authorize a connection.
Syntax
HRESULT OnConnectionAuthorized(
[in] HRESULT hrIn,
[in] GUID mainSessionId,
[in] ULONG cbSoHResponse,
[in] BYTE *pbSoHResponse,
[in] ULONG idleTimeout,
[in] ULONG sessionTimeout,
[in] SESSION_TIMEOUT_ACTION_TYPE sessionTimeoutAction,
[in] AATrustClassID trustClass,
[in] PolicyAttributes policyAttributes
);
Parameters
[in] hrIn
The result of the authorization attempt. Specify S_OK to indicate that the attempt succeeded. Specify any other value to indicate that the attempt failed.
[in] mainSessionId
A unique identifier assigned to the connection request by RD Gateway.
[in] cbSoHResponse
The number of bytes referenced by the pbSoHResponse parameter.
[in] pbSoHResponse
A pointer to a BYTE that specifies the response to the request for a statement of health (SoH). If the hrIn parameter is not S_OK, this parameter is ignored.
[in] idleTimeout
The number of minutes that the connection can remain idle before being disconnected. If the hrIn parameter is not S_OK, this parameter is ignored.
[in] sessionTimeout
The maximum number of minutes allotted to the session. If the hrIn parameter is not S_OK, this parameter is ignored.
[in] sessionTimeoutAction
The action to be taken when the session times out. If the hrIn parameter is not S_OK, this parameter is ignored. This parameter can be one of the following values.
SESSION_TIMEOUT_ACTION_DISCONNECT
Disconnect the session.
SESSION_TIMEOUT_ACTION_SILENT_REAUTH
Silently reauthenticate and reauthorize the session.
[in] trustClass
This parameter is reserved. Always set it to AA_TRUSTEDUSER_TRUSTEDCLIENT. If the hrIn parameter is not S_OK, this parameter is ignored.
[in] policyAttributes
An array of Boolean values that specify the redirection settings associated with the connection. Each element of the array corresponds to a value of the PolicyAttributeType enumeration. If the hrIn parameter is not S_OK, this parameter is ignored.
Return value
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
You can call this method from your implementation of AuthorizeConnection. If authentication requires more than 1 second, we recommend launching a separate thread to perform authentication.
For a sample that uses the OnConnectionAuthorized method, see the Remote Desktop Gateway Pluggable Authentication and Authorization sample.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows 7 |
| Minimum supported server | Windows Server 2008 R2 |
| Target Platform | Windows |
| Header | tsgpolicyengine.h |