On 18/03/13 22:51, David Muir wrote:
I've just set up a login form using the
Zend\Authorization\Validator\Authorization.
Overall things are working reasonably well, but there are few
annoyances/oddities.
First, to load the validator, I have to reference the full classname
"Zend\Authorization\Validator\Authorization" instead of a short name like you can with the standard
validators (e.g. "EmailAddress" instead of "Zend\Validator\EmailAddress").
Sorry, Authentication, not Authorization
Figured out that it is not registered by default with the validator
plugin manager. I tried adding to my module.config.php:
'validators' => array(
'invocables' => array(
'Authentication' => 'Zend\Authentication\Validator\Authentication'
),
),
But I still get a ServiceNotFoundException.
I'm also wanting to use some custom validators, but I can't get them
working either.
I've tried moving the config to Module.php using
ValidatorProviderInterface and getValidatorConfig() and still no go.
Tried using a factory too, and it seems the factory never gets called.
Very frustrating since the docs only show how to create validators, but
not set them up with the ValidatorPluginManager.
Secondly, sometimes the error is related to the identity, and sometimes the
error is related to the credential, but the validator is attached to only one
of the two elements. Is there a way to attach the validator to an input filter
without having to attach it to a particular input?
Figured out a workaround using a dummy hidden element to attach the
validator to, and then display the error further up the form. Anybody
have a better solution?
Cheers,
David
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]