Module Expr Str Import alias identifier Import alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Assign NameStore NameLoad orelse Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad NameLoad If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot NameLoad body AugAssignAdd NameStore BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad AttributeLoad NameLoad attr attr body Return AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str If CompareNotEq Call NameLoad SubscriptLoad NameLoad Index Str Str body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call SubscriptLoad AttributeLoad NameLoad attr Index Str Call SubscriptLoad AttributeLoad NameLoad attr Index Str keyword Str keyword Str Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call NameLoad keyword NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str keyword NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str Str body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call SubscriptLoad AttributeLoad NameLoad attr Index Str Call SubscriptLoad AttributeLoad NameLoad attr Index Str keyword Str keyword Str Assign NameStore AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad Call NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Raise Call NameLoad Num BinOpAdd BinOpAdd Str NameLoad Str keyword NameLoad Return NameLoad decorator_list decorator_list
N/A N/A 
Written by Michele Comitini <mcm@glisco.it>
License: GPL v3

Adds support for  OAuth1.0a authentication to web2py.

Dependencies:
 - python-oauth2 (http://github.com/simplegeo/python-oauth2)

 N/A oauth2 oauth N/A cgi urllib urlencode gluon current OAuthAccount N/A object N/A N/A 
    Login will be done via   OAuth Framework, instead of web2py's
    login form.

    Include in your model (eg db.py)::
        # define the auth_table before call to auth.define_tables()
        auth_table = db.define_table(
           auth.settings.table_user_name,
           Field('first_name', length=128, default=""),
           Field('last_name', length=128, default=""),
           Field('username', length=128, default="", unique=True),
           Field('password', 'password', length=256,
           readable=False, label='Password'),
           Field('registration_key', length=128, default= "",
           writable=False, readable=False))

        auth_table.username.requires = IS_NOT_IN_DB(db, auth_table.username)
        .
        .
        .
        auth.define_tables()
        .
        .
        .

        CLIENT_ID="<put your fb application id here>"
        CLIENT_SECRET="<put your fb application secret here>"
        AUTH_URL="..."
        TOKEN_URL="..."
        ACCESS_TOKEN_URL="..."
        from gluon.contrib.login_methods.oauth10a_account import OAuthAccount
        auth.settings.login_form=OAuthAccount(globals(
            ),CLIENT_ID,CLIENT_SECRET, AUTH_URL, TOKEN_URL, ACCESS_TOKEN_URL)

     __redirect_uri N/A N/A self next N/A None N/A N/A Build the uri used by the authenticating server to redirect
        the client back to the page originating the auth request.
        Appends the _next action to the generated url so the flows continues.
         N/A r N/A self request N/A http_host N/A N/A r env http_host N/A url_scheme N/A N/A r env wsgi_url_scheme N/A next N/A N/A path_info next N/A N/A path_info N/A N/A r env path_info N/A uri N/A %s://%s%s N/A url_scheme http_host path_info N/A N/A N/A r get_vars N/A next N/A N/A uri N/A ? N/A urlencode N/A r get_vars N/A uri N/A accessToken N/A N/A self N/A N/A N/A Return the access token generated by the authenticating server.

        If token is already in the session that one will be used.
        Otherwise the token is fetched from the auth server.

         N/A N/A N/A self session access_token N/A N/A N/A N/A self session access_token N/A N/A N/A self session request_token N/A N/A token N/A N/A self session request_token N/A N/A N/A self session request_token None N/A N/A N/A token set_verifier N/A N/A N/A self request vars oauth_verifier N/A client N/A N/A oauth Client N/A self consumer token N/A N/A resp content N/A N/A client request N/A self access_token_url POST N/A N/A N/A str N/A resp N/A status 200 N/A N/A N/A N/A self session request_token None N/A N/A N/A N/A self globals N/A redirect N/A N/A N/A self globals N/A URL f user args logout N/A N/A N/A self session access_token N/A N/A N/A oauth Token from_string content N/A N/A N/A self session access_token N/A N/A N/A self session access_token None N/A None N/A __init__ N/A N/A self g client_id client_secret auth_url token_url access_token_url socket_timeout N/A 60 N/A N/A N/A self globals g N/A N/A self client_id client_id N/A N/A self client_secret client_secret N/A N/A self code None N/A N/A self request N/A current request N/A N/A self session N/A current session N/A N/A self auth_url auth_url N/A N/A self token_url token_url N/A N/A self access_token_url access_token_url N/A N/A self socket_timeout socket_timeout N/A N/A self consumer N/A N/A oauth Consumer N/A self client_id N/A self client_secret N/A login_url N/A N/A self next N/A / N/A N/A N/A N/A self __oauth_login next N/A next N/A logout_url N/A N/A self next N/A / N/A N/A N/A N/A self session request_token None N/A N/A N/A self session access_token None N/A next N/A get_user N/A N/A self N/A N/A N/A Get user data.

        Since OAuth does not specify what a user
        is, this function must be implemented for the specific
        provider.
         N/A N/A NotImplementedError Must override get_user() N/A __oauth_login N/A N/A self next N/A N/A N/A This method redirects the user to the authenticating form
        on authentication server if the authentication code
        and the authentication token are not available to the
        application yet.

        Once the authentication code has been received this method is
        called to set the access token into the session by calling
        accessToken()
         N/A N/A N/A N/A self accessToken N/A N/A client N/A N/A oauth Client N/A self consumer None timeout N/A self socket_timeout N/A callback_url N/A N/A self __redirect_uri next N/A data N/A urlencode N/A dict oauth_callback callback_url N/A N/A resp content N/A N/A client request N/A self token_url POST body data N/A N/A N/A resp N/A status 200 N/A N/A N/A N/A self session request_token None N/A N/A N/A N/A self globals N/A redirect N/A N/A N/A self globals N/A URL f user args logout N/A request_token N/A N/A self session request_token N/A N/A N/A oauth Token from_string content N/A data N/A urlencode N/A dict oauth_token N/A request_token key oauth_callback callback_url N/A auth_request_url N/A N/A N/A self auth_url ? data N/A HTTP N/A N/A self globals N/A HTTP N/A N/A HTTP 302 N/A N/A You are not authenticated: you are being redirected to the <a href=' auth_request_url '> authentication server</a> Location auth_request_url N/A None N/A N/A