You should be using DI and throwing things into header defaults.

Otherwise you won't be promoting DRY.

Anyway, when you get to that point you move away from web2py (like I have
done). Recommend checking out Bottle.


Samuel Marks
http://linkedin.com/in/samuelmarks


On Wed, Apr 30, 2014 at 12:06 AM, samuel bonill <pythonn...@gmail.com>wrote:

> my solution to store access tokens, i use angularjs on a phonegap
> application to store the access tokens, based on this article :
>
>
> https://auth0.com/blog/2014/01/07/angularjs-authentication-with-cookies-vs-token/
>
> example :
>
> $http
>       .post('/default/api/users', $scope.user)
>       .success(function (data, status, headers, config) {
>         $window.sessionStorage.token = data.token;
>         $scope.message = 'Welcome';
>       })
>
>
>
> 2014-04-29 8:41 GMT-05:00 Leonel Câmara <leonelcam...@gmail.com>:
>
>> Oh the users themselves login. I was interested in knowing if you had a
>> solution to store API tokens, the same way you need to store API keys for
>> google and facebook as right now I don't see how I can safely put them in
>> the mobile app and I have to use my server as a middlemen. The point also
>> being to prevent other people from using your API.
>>
>> --
>> 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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/lXfe0tpGi8U/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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.
>

-- 
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