CSharpRTMP.Core.Protocols.Rtsp.BaseRtspAppProtocolHandler.SendAuthenticationChallenge C# (CSharp) Method

SendAuthenticationChallenge() private method

private SendAuthenticationChallenge ( RtspProtocol from, Variant realm ) : bool
from RtspProtocol
realm Variant
return bool
        private bool SendAuthenticationChallenge(RtspProtocol from, Variant realm)
        {
            //10. Ok, the user doesn't know that this needs authentication. We
            //will respond back with a nice 401. Generate the line first
            string wwwAuthenticate = HTTPAuthHelper.GetWWWAuthenticateHeader(
                    realm["method"],
                    realm["name"]);

            //12. Save the nonce for later validation when new requests are coming in again
            from.CustomParameters["wwwAuthenticate"] = wwwAuthenticate;

            //13. send the response
            from.PushResponseFirstLine(RTSP_VERSION_1_0, 401, "Unauthorized");
            from.PushResponseHeader(HTTP_HEADERS_WWWAUTHENTICATE, wwwAuthenticate);
            return from.SendResponseMessage();
        }