[Catalyst] Authentication for web services (slightly off topic)

Christopher H. Laco claco at chrislaco.com
Wed Jan 23 15:30:51 GMT 2008


Andrew Payne wrote:
> On Jan 23, 2008 2:30 PM, Ian Docherty <catalyst at iandocherty.com> wrote:
>> This might seem like a stupid question, and one that probably has a
>> I could use Apache Basic Authentication, but I would prefer to hold
>> usernames passwords in
>> a database rather than a htpasswd file.
> =

> Just do
> =

>     my ($username, $password) =3D $c->req->headers->authorization_basic;
> =

> There's no need to have Apache handle it.
> =

> I have an app with both an HTML and a REST/XML interface (under
> '/REST/'), and simply give the REST controller its own auto() sub,
> containing the above line. Works fine.
> =

> Andrew

I went down an similar somewhat evil path for Mango.
Since Mango has a custom Auth store/user anyways, I make my authenticate =

forward to authorization_basic when no options were passed:

   ## uses Auth/Store
   $c->authenticate({
     username =3D> $user, password =3D> $pass
   });

   ## uses HTTP Auth plugin
   $c->authenticate();

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080123/8139=
7852/signature.pgp


More information about the Catalyst mailing list