[imp] Re: Providing alternative credentials for automatic IMP authentication

Chuck Hagenbuch chuck at horde.org
Wed Apr 13 08:10:02 PDT 2005


Quoting canobi at irantthereforeiam.com:

> 1. add another possible value to 'hordeauth' server flag (let's
> say the value would be 'alt' - for 'alternative')
> 2. change Auth_imp::authenticate to check for that value and if
> $ptr['hordeauth'] == 'alt' then fill in $imapuser and $pass local
> variables from Auth::getCredential('impusername') and
> Auth::getCredential('imppassword'). The global credentials would
> be placeholders to be filled in by custom Horde Auth modules
> (I'll also have to code one specific to my deployment).
>  Is the described way the "right" way to do it in Horde and IMP?
> If not, how do you suggest I go about implementig the required
> functionality?

I'm not sure if you can do it with an existing hook, but I'm guessing 
not. I'd add an IMP-local version of the Horde preauthenticate (and 
postauthenticate, for completeness) hooks. Use the custom auth driver 
to set 'imapusername' and 'imappassword' credentials (I'd personally 
avoid reference to IMP, but that's your call since this will be your 
local hook code), and use the hooks to switch the right credentials in 
and out (switch to IMP credentials pre-auth, and switch back post-auth).

I'd definitely look at a patch for those hooks.

>  I rather prefer the second option, but maybe there are some
> objective reasons for the first one, so I'm asking, just in case
> I'm not aware of them :-)

I'd go with the switch, personally.

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the imp mailing list