Hello,
I'm trying to use web2py to build a JSON based API (not REST though) for a 
mobile and single-page-application client.

I wonder if there is a simple way to use Web2py internals like auth and 
session global object for such a case?

For example, in regular web-based app web2py "magically" restore a user and 
a session using cookies. In API environment it is not possible. Would it be 
possible instead to generate a token upon a login and then associate auth 
and session objects with that token. Then on every API function that 
requires login perform a decoration function to look up a token that client 
sends and restore auth and session objects associated with it, and later 
use it in the function as we would in a normal web-based app. Is there a 
way to do that?

Best,
Darko

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to