Definitely something has gone awry there. I replaced "ldap_auth.py" and 
"ldap_auth.pyc" from the 2.12.3 version and it works again.


On Thursday, December 24, 2015 at 12:11:27 PM UTC-5, Seth J wrote:
>
> Hi Massimo,
>
> I just upgraded from 2.9.5 and it seemed to kill my LDAP authorization:
>
> <type 'exceptions.SyntaxError'> invalid syntax (ldap_auth.py, line 435)
> Versionweb2py™Version 2.13.3-stable+timestamp.2015.12.24.15.09.20PythonPython 
> 2.6.6: /usr/bin/python (prefix: /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
>
> Traceback (most recent call last):
>   File "/opt/web-apps/web2py/gluon/restricted.py", line 227, in restricted
>     exec ccode in environment
>   File "/opt/web-apps/web2py/applications/CongressionalFoxPro/models/db.py" 
> <https://hqvmlxbgzla02.gpo.gov/admin/default/edit/CongressionalFoxPro/models/db.py>,
>  line 81, in <module>
>     from gluon.contrib.login_methods.ldap_auth import ldap_auth
>   File "/opt/web-apps/web2py/gluon/custom_import.py", line 108, in 
> custom_importer
>     return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
>   File "/opt/web-apps/web2py/gluon/contrib/login_methods/ldap_auth.py", line 
> 435
>     update_or_insert_values = {f: update_or_insert_values[f] for f in fields}
>                                                                ^
> SyntaxError: invalid syntax
>
> Error snapshot [image: help] 
> <https://hqvmlxbgzla02.gpo.gov/admin/default/ticket/CongressionalFoxPro/172.24.216.193.2015-12-24.11-48-03.f24e6cfa-e08c-464b-8b30-32deddfcb84c#>
>
> <type 'exceptions.SyntaxError'>(invalid syntax (ldap_auth.py, line 435))
>
> On Thursday, December 24, 2015 at 10:21:42 AM UTC-5, Massimo Di Pierro 
> wrote:
>>
>> web2py 2.13.3 is out. MERRY CHRISTMAS EVERYBODY!!!
>>
>> It contains some bug fixes for bugs introduced in 2.13.1-2 and most 
>> importantly it contains experimental support for JWT. Here is how it works:
>>
>>         1) instantiate auth with
>>
>>             auth = Auth(db, jwt = {'secret_key':'secret'})
>>
>>         where 'secret' is your own secret string. 
>>
>>         2) Secorate functions that require login but should accept the 
>> JWT token credentials:
>>
>>             @auth.allows_jwt()
>>             @auth.requires_login()
>>             def myapi(): return 'hello %s' % auth.user.email
>>     
>>         Notice jwt is allowed but not required. if user is logged in, 
>> myapi is accessible.
>>
>>         3) Use it!
>>         Now API users can obtain a token with
>>
>>             http://.../app/default/user/jwt?username=...&password=....
>>
>>         (returns json object with a token attribute)
>>         API users can refresh an existing token with
>>
>>             http://.../app/default/user/jwt?token=...
>>
>>         they can authenticate themselves when calling http:/.../myapi by 
>> injecting a header
>>
>>             Authorization: Bearer <the jwt token>
>>
>>         Any additional attributes in the jwt argument of Auth() below:
>>
>>            auth = Auth(db, jwt = {...})
>>
>>         are passed to the constructor of class AuthJWT. Look there for 
>> documentation.
>>
>> Thanks Niphlod again for implementing this. 
>> Please help us check it so we will declare it stable in the next release.
>>
>> Massimo
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to