Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Authentication #941

Closed
mbelletti opened this issue Apr 23, 2015 · 3 comments
Closed

Basic Authentication #941

mbelletti opened this issue Apr 23, 2015 · 3 comments

Comments

@mbelletti
Copy link
Contributor

It seems that the feature described here in the book doesn't work.

I tried both methods

auth.settings.allow_basic_login = True

and

auth.basic()

without results.

I tried on the standalone web2py rocket on osx 10.10.3 and on nginx + uwsgi on debian wheezy.

@mbelletti
Copy link
Contributor Author

I don't know if It is a client problem.

wget doen't work, curl it does.

@michele-comitini
Copy link
Contributor

It is a documentation problem I suppose, since the basic auth is without challenge by default (not the standard by HTTP/1.1).

Do following tests:

  1. use --auth-no-challenge invoking wget
  2. try to enable by setting basic_auth_realm=True.

in gluon/tools.py:

   def basic(self, basic_auth_realm=False):
        """
        Performs basic login.

       Args:
        basic_auth_realm: optional basic http authentication realm. Can take
            str or unicode or function or callable or boolean.

       reads current.request.env.http_authorization
       and returns basic_allowed,basic_accepted,user.

       if basic_auth_realm is defined is a callable it's return value
       is used to set the basic authentication realm, if it's a string
       its content is used instead.  Otherwise basic authentication realm
       is set to the application name.
       If basic_auth_realm is None or False (the default) the behavior
       is to skip sending any challenge.

       """

@mbelletti
Copy link
Contributor Author

wget with:
--auth-no-challenge

do the trick!

We should update the docs.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants