Aha!
I just had to add this:
def test():
if request.env.http_authorization==None:
response.headers['WWW-Authenticate'] = 'Basic realm="%s"' %
(request.application)
response.status = 401
return 'hello'
code=request.env.http_authorization[6:]
dec=base64.b64decode(code)
All fixed, my mistake.
Cheers,
Clayton
On Nov 8, 10:56 pm, mdipierro <[email protected]> wrote:
> web2py does not touches that... it must be in request.env somewhere.
>
> On Nov 8, 8:59 pm, Clayton <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I created a controller function:
>
> > def test():
> > return dict(x=1)
>
> > which I call as follows:
>
> >http://someuser:xy...@localhost:8080/myapp/default/test
>
> > from Chrome and also from C#. In both cases,
> > request.env.http_authorization is always None and I can find no trace
> > of xyzzy or someuser in the request object at all.
>
> > How do I get the username and password that was passed in?
>
> > Thanks,
>
> > Clayton