Class<? extends Authentication> toTest = authentication.getClass();
while (iter.hasNext())
{
SecurityProvider provider = iter.next();
if (provider.supports(toTest))
{
return provider.createSecurityContext(authentication);
}
}
throw new UnknownAuthenticationTypeException(authentication);