RE: C# WMS Authentication plugin enabling problem
- From: javatopia <javatopia@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 19 Sep 2007 09:48:01 -0700
Hello,
Your code:
public string GetProtocolName()
{
return "Custom";
}
Should be either:
public string GetProtocolName()
{
return "Basic";
}
or
public string GetProtocolName()
{
return "Digest";
}
The WMS client only understands authentication protocols that are common to
the internet. If you do Basic, then you will get the username and password in
plaintext. If you do the Digest authentication scheme, then you will need to
do a considerable amount of additional programming to make it work. With
Digest authentication, the client does not provide a plaintext password, so
you will need to have a way to get that plaintext password on the server
side. If not, then you can not do Digest authentication.
-- Jake
--
Jacob W Anderson
---
http://www.beyond-ordinary.com
http://www.extremeplannerlive.com
---
If you think it''''s expensive to hire a professional to do the job, wait
until you hire an amateur.
"KubaF" wrote:
.
Hello
One of my client requires WMS video streaming with user/password
chellenge over his MS-SQL DB.
As far i read standard WMS plugins it's not possible to create this
funcionality with standard plugins, so i'am trying to develope my own
authentication plugin. And here starts problems.
Plugin code
[Guid("D3217092-3EC0-4d0a-9856-91E73E19BD07")]
public class AuthenticationPlugin : IWMSBasicPlugin,
IWMSAuthenticationPlugin, IWMSAuthenticationContext
{
#region IWMSBasicPlugin Members
public void DisablePlugin()
{
}
public void EnablePlugin(ref int plFlags, ref int
plHeartbeatPeriod)
{
}
public object GetCustomAdminInterface()
{
return null;
}
public void InitializePlugin(IWMSContext pServerContext,
WMSNamedValues pNamedValues, IWMSClassObject pClassFactory)
{
}
public void OnHeartbeat()
{
}
public void ShutdownPlugin()
{
}
#endregion
#region IWMSAuthenticationPlugin Members
public IWMSAuthenticationContext CreateAuthenticationContext()
{
return (IWMSAuthenticationContext)this;
}
public int GetFlags()
{
return Convert.ToInt32(
WMS_AUTHENTICATION_FLAGS.WMS_AUTHENTICATION_TEXT_CHALLENGE |
WMS_AUTHENTICATION_FLAGS.WMS_AUTHENTICATION_CLIENT_SHOWS_UI |
WMS_AUTHENTICATION_FLAGS.WMS_AUTHENTICATION_CHALLENGE_FIRST);
}
public string GetPackageName()
{
return "TiVi.WMSAuthentication";
}
public string GetProtocolName()
{
return "Custom";
}
#endregion
#region IWMSAuthenticationContext Members
public void Authenticate(object ResponseBlob, IWMSContext
pUserCtx, IWMSContext pPresentationCtx, IWMSCommandContext
pCommandContext, IWMSAuthenticationCallback pCallback, object Context)
{
pCallback.OnAuthenticateComplete(WMS_AUTHENTICATION_RESULT.WMS_AUTHENTICATION_SUCCESS,
null, Context);
}
public IWMSAuthenticationPlugin GetAuthenticationPlugin()
{
return (IWMSAuthenticationPlugin)this;
}
public string GetImpersonationAccountName()
{
return "";
}
public int GetImpersonationToken()
{
return 0;
}
public string GetLogicalUserID()
{
return "";
}
#endregion
}
COM register / unregister code:
public class Com
{
[ComRegisterFunctionAttribute]
public static void RegisterFunction(Type t)
{
try
{
RegistryKey regHKLM = Registry.LocalMachine;
regHKLM =
regHKLM.CreateSubKey("SOFTWARE\\Microsoft\\Windows
Media\\Server\\RegisteredPlugins\\Authentication\\{D3217092-3EC0-4d0a-9856-91E73E19BD07}");
regHKLM.SetValue(null, "TiVi WMS Authentication
plugin");
RegistryKey regHKCR = Registry.ClassesRoot;
regHKCR =
regHKCR.CreateSubKey("CLSID\\{D3217092-3EC0-4d0a-9856-91E73E19BD07}\\Properties");
regHKCR.SetValue("Name", "TiVi WMS Authentication
plugin");
regHKCR.SetValue("Author", "Comtica");
regHKCR.SetValue("Copyright", "Copyright © Comtica
2007");
regHKCR.SetValue("Description", "TiVi WMS
authentication plugin");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Cannot Register",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
[ComUnregisterFunctionAttribute]
public static void UnRegisterFunction(Type t)
{
try
{
RegistryKey regHKLM = Registry.LocalMachine;
regHKLM.DeleteSubKey("SOFTWARE\\Microsoft\\Windows
Media\\Server\\RegisteredPlugins\\Authentication\\{D3217092-3EC0-4d0a-9856-91E73E19BD07}");
RegistryKey regHKCR = Registry.ClassesRoot;
regHKCR.DeleteSubKeyTree("CLSID\\{D3217092-3EC0-4d0a-9856-91E73E19BD07}");
regHKCR.DeleteSubKeyTree("TiVi.WMSAuthentication.AuthenticationPlugin");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Cannot delete a subkey.",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
Problems which i notice so far:
- can't register (regasm.exe TiVi.WMSAuthentication.dll) when library
is placed in c:\windows\system32\windows media\server; keep getting
error "RegAsm : error RA0000 : Unable to
dll' or one of its dependencies."
So i register library in other folder (program files) and after i
copied files to windows media\server and manually install in GAC
- next problem i noticed that Com class is called but none of register
keys isnt writed to registers; so i prepared reg files to write them
manually:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
Media\Server\RegisteredPlugins\Authentication\{D3217092-3EC0-4d0a-9856-91E73E19BD07}]
@="TiVi WMS Authentication plugin"
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{D3217092-3EC0-4d0a-9856-91E73E19BD07}]
[HKEY_CLASSES_ROOT\CLSID\{D3217092-3EC0-4d0a-9856-91E73E19BD07}\Properties]
"Name"="TiVi WMS Authentication plugin"
"Author"="Comtica"
"Copyright"="Copyright © Comtica 2007"
"Description"="TiVi WMS authentication plugin"
After all that tricks i see plugin in authentication plugins in WMS but
i can't enable it, all time getting error "Error description: The
plug-in has reportered an error. See event viewer ... bla bla. Error
code: 0xc00d157d"
and in event viewer i got "Server failed with the following
information: Error code = 0x80131040, Error text = ''TiVi WMS
Authentication plugin''."
For testing i'am using windows 2003 enterprise with latest updates.
.NET library is comvisible and signed.
Any one had similar problem or can tell me what i'am doing wrong, can
send me some .NET wms plugin working template, because now i'am out of
any ideas.
best regards
Kuba Florczyk
--
KubaF
------------------------------------------------------------------------
KubaF's Profile: http://forums.techarena.in/member.php?userid=30701
View this thread: http://forums.techarena.in/showthread.php?t=814188
http://forums.techarena.in
- References:
- C# WMS Authentication plugin enabling problem
- From: KubaF
- C# WMS Authentication plugin enabling problem
- Prev by Date: Re: how to decode mms url
- Next by Date: Re: Windows Media Services Fatal Error
- Previous by thread: C# WMS Authentication plugin enabling problem
- Next by thread: Re: C# WMS Authentication plugin enabling problem
- Index(es):
Relevant Pages
|