Hi all!
I thought about changing the Webdav API for authentication slightly
before we once go stable with it, to make it easier for people to
implement additional / custom authentication schemes (like NTLM).
We currently have 3 interfaces for authentication:
interface ezcWebdavAnonymousAuthenticator
{
public function authenticateAnonymous(
ezcWebdavAnonymousAuth $data
);
}
interface ezcWebdavBasicAuthenticator extends
ezcWebdavAnonymousAuthenticator
{
public function authenticateBasic( ezcWebdavBasicAuth $data );
}
interface ezcWebdavDigestAuthenticator extends
ezcWebdavBasicAuthenticator
{
public function authenticateDigest( ezcWebdavDigestAuth $data );
}
This means, that the server currently decides, which authenticator is
capable to handle which type of credential struct.
I'd suggest to go for a single authenticator interface now:
interface ezcWebdavAuthenticator
{
public function authenticate( ezcWebdavCredentials $auth );
public function getAuthHeader( $realm );
}
authenticate() returns true on successfull authentication, false on
failure and throws an exception if a struct is received that could not
be handled. getAuthHeader() returns an array of WWW-Authenticate headers
indicating which types of authentication are supported.
This would allow users to implement their custom authentication schemes
more easily. They need to extend the transport (and possibly client
specific transports), add a new credential struct and implement the
neccessary authentication() methods.
To make it easier to have basic and digest auth, I'd provide 2 abstract
base classes (1 for basic and anonymous, 1 for basic, digest and
anonymous) that produce the correct headers.
In addition I'd like to make the authorize() methods
(ezcWebdav(Lock)Authorizer) recieve the complete credential struct
instead of the username only. Just for the case that some authentication
scheme does not work with a username.
Does that sound reasonable to you?
Regards,
Toby
--
Mit freundlichen Grüßen / Med vennlig hilsen / With kind regards
Tobias Schlitt (GPG: 0xC462BC14) eZ Components Developer
[EMAIL PROTECTED] | eZ Systems AS | ez.no
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components