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

Ian Docherty catalyst at iandocherty.com
Wed Jan 23 15:39:18 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.
>   =

I am slow today. What you said here has slowly percolated through my =

thick head! I could
not get it out of my mind that I had to set up Apache to request basic =

authentication for (in your
example) the '/REST/' location. Obviously I don't need to do that so =

long as the Catalyst App
is able to read the authentication data sent by the client system!

Thanks. That solves my problem I believe.
Regards
Ian
> Andrew
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u=
k/
> Dev site: http://dev.catalyst.perl.org/
>
>   =


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080123/e1d7b=
5fb/attachment.htm


More information about the Catalyst mailing list