Reprinted:
It has long been known that "User playback authentication" is available in RealSystem ". When this module is enabled, users can be limited to programs that can be viewed by users. The player on the user end will first pop up a dialog box asking users to enter the user name and password (pre-allocated by the Streaming Media Server administrator ). However, this function is basically not available in Windows Media Service. Only a "release point security" setting page is available in "server properties. Microsoft only provides three simple default client user authentication packages. I believe everyone knows this. Therefore, I have long had an idea. Can I develop a user verification package plug-in that meets my own requirements? Recently, I downloaded Windows Media Service SDK 4.1 from the Microsoft website and found that it provides complete help information for programming. So it took me two days to finally compile a user verification package plug-in that fully complies with my requirements and runs on a Windows 2000 server that has started Microsoft Media, when a user accesses streaming media on the server through Windows Media Player, the user is required to enter a valid user name and password first. The server queries user information in the custom database through ADO dB and checks the identity, after the verification is passed, users can play streaming media content, and access logs are recorded for users based on each North-accessed streaming media file. The effect is good.
the client user authentication package plug-in for Windows Media Service is based on the COM component object model structure. The key is that the developer must implement two interfaces, inssauthenticator and inssuserauthentication. Microsoft requires that the COM component be a free thread model, that is, multi-thread concurrency is supported. In general, we use the HTTP-BASIC interaction protocol between users and media service information exchange, suitable for Internet transmission. At the same time, Media Player uses base64 encoding to encode the user name, password, and other information sent to media service (which is a small encryption) and send it to the server. After receiving this information, our own authentication package plug-in can perform user identity authentication. You can use this information as needed, such as combining the database system (user information and stored in the database) and so on. In addition, you can design user access logs by yourself. As for the current situation, the tracking information record of user access to the media server can reach the level of each program accessed (each stream file. If you want to time user access, you may need to combine the Windows Media Service event authentication API to write additional COM components. The database is actually very simple, because I don't have much time, so I replaced it with Microsoft Access database. The entire plug-in is written in C ++ Builder 5. I don't use VC because I think VC's ATL is annoying, and C ++ Builder 5's built-in COM framework is not very good, therefore, I wrote a simple but practical com frame. Although it is much less functional than CB 5's com frame, it is enough to compile COM components that are not very complex, the size of the generated file is greatly reduced.