/// <devdoc>
/// <para>
/// Binds an authentication response to a request for pre-authentication.
/// </para>
/// </devdoc>
// Create binding between an authorization response and the module
// generating that response
// This association is used for deciding which module to invoke
// for preauthentication purposes
public override void BindModule(Uri uri, Authorization response, IAuthenticationModule module)
{
GlobalLog.Assert(
module.CanPreAuthenticate,
"AuthenticationManager::BindModule()|module.CanPreAuthenticate == false");
if (response.ProtectionRealm != null)
{
// The authentication module specified which Uri prefixes
// will be preauthenticated
string[] prefix = response.ProtectionRealm;
for (int k = 0; k < prefix.Length; k++)
{
//
// PrefixLookup is thread-safe
//
moduleBinding.Add(prefix[k], module.AuthenticationType);
}
}
else
{
// Otherwise use the default policy for "fabricating"
// some protection realm generalizing the particular Uri
string prefix = generalize(uri);
//
// PrefixLookup is thread-safe
//
moduleBinding.Add(prefix, module.AuthenticationType);
}
}