The RequireAuthentication method can be used within an
OnCommand event handler to indicate to the client that it
must provide a username and password to access the requested resource.
The client should respond by issuing another request that includes the
required credentials. To determine if a client has included valid
credentials with its request, check the value of the IsAuthenticated
property.
Some clients may require that the session be secure if
authentication is requested or display warning messages to the user if
the connection is not secure. If your application will require clients
to authenticate before accessing specific resources, it is recommended
that you enable security by setting the Secure property to
True prior to starting the server.