[Live-devel] Slight authentication change

Ross Finlayson finlayson at live555.com
Wed Nov 17 00:07:24 PST 2010


>We updated the "UserAuthenticationDatabase" used in the RTSP server 
>to have a "requireAuthentication" method that can be overridden in a 
>derived class.  We use it so that if default credentials are in use, 
>we don't require authentication.
>
>Basically, this allows implementations to turn authentication on and 
>off at will while the server is running.  Unless implementations 
>override requireAuthentication, the behavior is identical to the 
>previous code.
>
>It's a pretty simple change so hopefully it's good enough for inclusion.

Yes.  In fact, I can think of another way to do this that's even 
simpler, yet more general:

Add a new member function
	UserAuthenticationDatabase* 
RTSPServer::setAuthenticationDatabase(UserAuthenticationDatabase* 
newDB);
This would change the server's authentication database, and return 
the existing one (perhaps NULL).

Then, you could turn off authentication simply by doing:
	UserAuthenticationDatabase* oldDB = 
myServer->setAuthenticationDatabase(NULL);
and turn it back on by doing:
	myServer->setAuthenticationDatabase(oldDB);
This also has the benefit of not requiring an additional check in the 
server; the existing check against NULL is sufficient.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list