I think session.forget is just for optimization since most services
won't need to track sessions. You can remove it if you need session
cookies.

On Dec 9, 6:41 am, Miguel Lopes <[email protected]> wrote:
> I have call() there, but I'm curious about your use of session.forget()
> Why is this needed.
>
> Nice idea on using the auth.is_logged_in() inside the service
> procedure. That is a nice approach to authenticate the service.
>
> I was having some problems so solved the problem with a temp token.
> However, I've just upgrade due to a bug, so I'll retry the
> authentication.
>
> Txs,
> Miguel
>
> On Wed, Dec 9, 2009 at 12:24 PM, mr.freeze <[email protected]> wrote:
> > You should have a call function in your controller:
> > def call():
> >    ...
> >    session.forget()
> >    return service()
>
> > You can expose a function like so:
> > @service.run
> > def add_two(a,b):
> >    if auth.is_logged_in():
> >        return a+b
> >    return 'unauthorized'
>
> > You can call like:
> >http://127.0.0.1:8000/app/default/call/run/add_two?a=hello&b=world
> >http://127.0.0.1:8000/app/default/call/run/add_two/hello/world
>
> > Is that what you're looking for?
>
> > On Dec 8, 11:59 am, Miguel Lopes <[email protected]> wrote:
> >> Hi,
>
> >> I'm looking to service another application with a web2py service.
> >> A goal is connect to web2py and download a file via a webservice. I've
> >> managed to do this using urllib (on the desktop client) and by
> >> exposing a service.run in web2py. But the access to the service must
> >> be secure, so I'm wondering on the way to authenticate it.
>
> >> On the client side: should / can urllib2 be used in this scenario
> >> (namely HTTPPassMgr)?
>
> >> On the web2py side: is there a standard way of exposing the run service?
>
> >> If there is a standard way I rather use it. Alternative, I would
> >> expose a custom login function through the service, return a temporary
> >> token and then use it in every call to exposed services. If there's no
> >> standard I wonder if any of you would suggest otherwise?
>
> >> I also wonder how an upload function exposed through this service
> >> would look like?
>
> >> Txs,
> >> Miguel

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to