<div>I have been working on an Authentication class for a project and was wanting to provide different authentication mechanisms.&nbsp; Basically, I want someone to be able to change their authentication scheme either on the fly or on a per-user basis and was wondering how the best way to go about this may be.
</div>
<div>&nbsp;</div>
<div>What I've got so far is a generic Authenticator class that takes one argument in the constructor of the type of authentication.&nbsp; My plan was to have it determine and automatically load the correct class for the authentication type.&nbsp; So I was going to have it return an object type of the new authentication object type (
i.e. LDAP, DB, or others), when I remembered something about not being able to return anything back from the constructor of an object in this language.</div>
<div>&nbsp;</div>
<div>Have others tackled this task before and what means did you use.&nbsp; I want my code to only include the generic authenticator class, but want a more specific object type returned.</div>