Re: C# WMS Authentication plugin enabling problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hey Richard,

I haven't understood what you are writing. But I thing you are wrong.
Just set "[assembly: ComVisible(true)]" in the AssemblyInfo.cs and you can
compile and register with asmreg for instance.
Concerning you second problem I opened a support call at Microsoft to solve
this problem. When I recieve a running code example I will post it in this
thread.

Basti

"Richard" wrote:

Hi, my friend. Have you solved your problem?
and in event viewer i got "Server failed with the following
information: Error code = 0x80131040, Error text = ''TiVi WMS
Authentication plugin''."
from the error code "0x80131040",it is likely that the assembly probing
redirects your assembly to a different one. For example, you have an
assembly called A.dll references another strong named assembly B.dll, but
when deployment, you misplace a non strong named version of B.dll. During
assembly probing, it will complain that "The located assembly's manifest
definition does not match the assembly reference". If it happens to be a COM
client, HRESULT:0x80131040 will throw.

Additionally, I am facing the same situation as you did. What I want is the
client authentication ticket (here it is username and passwordd because it
is an asp.net web app using Forms authentication mode) forwards to media
server where the plugin can extract the ticket and authenticates against
MS-SQL DB. But I don't grab any clue to how to extract this ticket info in
my plugin? Any suggestions to provide?

Thanks and Regards.

"KubaF" <KubaF.2wjhzd@xxxxxxxxxxxxx> дÈëÏûÏ¢ÐÂÎÅ:KubaF.2wjhzd@xxxxxxxxxxxxxxxx
> 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




.



Relevant Pages

  • C# WMS Authentication plugin enabling problem
    ... As far i read standard WMS plugins it's not possible to create this ... authentication plugin. ... public void EnablePlugin(ref int plFlags, ... MessageBox.Show(ex.Message, "Cannot Register", ...
    (microsoft.public.windowsmedia.server)
  • RE: C# WMS Authentication plugin enabling problem
    ... public string GetProtocolName() ... The WMS client only understands authentication protocols that are common to ... MessageBox.Show(ex.Message, "Cannot Register", ...
    (microsoft.public.windowsmedia.server)
  • Re: C# WMS Authentication plugin enabling problem
    ... compile and register with asmreg for instance. ... client authentication ticket (here it is username and passwordd because ... server where the plugin can extract the ticket and authenticates against ... public void EnablePlugin(ref int plFlags, ...
    (microsoft.public.windowsmedia.server)
  • Re: C# WMS Authentication plugin enabling problem
    ... client authentication ticket (here it is username and passwordd because it ... server where the plugin can extract the ticket and authenticates against ... public void EnablePlugin(ref int plFlags, ... MessageBox.Show(ex.Message, "Cannot Register", ...
    (microsoft.public.windowsmedia.server)
  • RE:[PHP] Client Computer Registration
    ... using any such method which requires such kind of an authentication. ... Basically I have to login using my Username and password and then I have to ... register the system and give it a label. ... I've heard of this situation in a bank before. ...
    (php.general)