ITSGAuthorizeResourceSink::OnChannelAuthorized method

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

Syntax

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

Parameters

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.

mainSessionId

A unique identifier assigned to the connection request by RD Gateway.

subSessionId

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

allowedResourceNames

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

numAllowedResourceNames

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

failedResourceNames

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

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.

Examples

For an example that uses the OnChannelAuthorized method, see Remote Desktop Gateway Pluggable Authentication and Authorization Sample.

Requirements

   
Windows version Windows 7 Windows Server 2008 R2
Target Platform Windows
Header tsgpolicyengine.h

See Also

ITSGAuthorizeResourceSink