The server running NetShow Theater Server calls the INSSEventAuthorization::AuthorizeEvent method to determine whether it performs the task associated with an event that requires authorization. When calling the method, the server supplies the component with information about the event, client, and content to be authorized.
If the authorization is a complicated and lengthy process, implement the AuthorizeEvent method in an asynchronous fashion, spawning another thread to determine if the request must be granted. Asynchronous implementation results in an immediate return of calls to the method, and frees the server to proceed with other tasks while the authorization is in progress. However, if the authorization is simple, the method must return synchronously; that is, it must return a call after the authorization is finished.
At the end of the authorization process, whether the request is granted or denied, the authorization component makes a call to the server to invoke the INSSEventAuthorizationCallback::OnEventAuthorized method. A pointer to the callback interface is passed in by the server when it invokes the AuthorizeEvent method. The authorization component must call this method, whether the AuthorizeEvent method returns synchronously or asynchronously.
To uniquely identify the event requested for authorization, both the server and the authorization component pass the dwRequestId parameter to each other. The server passes the parameter into the component through the call to the INSSEventAuthorization::AuthorizeEvent method. The authorization component must pass the same request identifier back to the server through the call to the INSSEventAuthorizationCallback::OnEventAuthorized method.
[Previous][Next]