I am using a dictionary in castle windsor configuration to build an
authenticator factory. The dictionary key represents a URL and then
the object represents each specific authenticator service.
//config
<component id="AuthenticatorFactory" lifestyle="singleton"
service="Security.IAuthenticatorFactory, Security"
type="Security.AuthenticatorFactory, Security">
<parameters>
<authenticators>
<dictionary>
<entry key="
https://smpc.acme.com/sts/sts.svc/
anonymoususer">${AnonymousUserAuthenticator}</entry>
<entry key="
https://wcvpc-w7.acme.com/sts/sts.svc/
anonymoususer">${AnonymousUserAuthenticator}</entry>
<entry key="
https://tkpc.acme.com/sts/sts.svc/
anonymoususer">${AnonymousUserAuthenticator}</entry>
</dictionary>
</authenticators>
</parameters>
</component>
//code
public class AuthenticatorFactory : IAuthenticatorFactory
{
private Dictionary<string, IAuthenticator> m_authenticators =
new Dictionary<string, IAuthenticator>();
public AuthenticatorFactory(Dictionary<string, IAuthenticator>
authenticators)
{
m_authenticators = authenticators;
}
public IAuthenticator GetAuthenticator(string url)
{
IAuthenticator retVal = null;
if (m_authenticators.ContainsKey(url))
{
retVal = m_authenticators[url.ToString()];
}
return retVal;
}
}
By default the dictionary appears to be case sensitive. Is there a
way to have castle construction a case insensitive dictionary?
scottm