ITSGAuthorizeResourceSink::OnChannelAuthorized method (tsgpolicyengine.h)

Notifies Remote Desktop Gateway (RD Gateway) about the result of an attempt to authorize a resource.

Syntax

HRESULT OnChannelAuthorized(
  [in] HRESULT hrIn,
  [in] GUID    mainSessionId,
  [in] int     subSessionId,
  [in] BSTR    *allowedResourceNames,
  [in] ULONG   numAllowedResourceNames,
  [in] BSTR    *failedResourceNames,
  [in] ULONG   numFailedResourceNames
);

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] subSessionId

A unique identifier assigned to the subsession by RD Gateway. A subsession is a session launched from another session.

[in] allowedResourceNames

A pointer to a BSTR that contains a list of resources that were successfully authorized.

[in] numAllowedResourceNames

The number of resources referenced by the allowedResourceNames parameter. If the function succeeds, this parameter must be one or more.

[in] failedResourceNames

A pointer to a BSTR that contains a list of resources that failed authorization.

[in] numFailedResourceNames

The number of resources referenced by the failedResourceNames parameter.

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 AuthorizeResource. If authorization requires more than 1 second, we recommend launching a separate thread to perform authentication.

For a sample that uses the OnChannelAuthorized 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

See also

ITSGAuthorizeResourceSink