On Wednesday, October 3, 2018 at 3:40:53 AM UTC-7, isi_jca wrote: > > Hi Everybody!! > > I am trying to use webservice and Jason Web Token > > > I have this controller: webservice.py > > from gluon.tools import AuthJWT > myjwt = AuthJWT(auth, > secret_key='my_especial_key',algorithm='HS512',user_param="email") > myjwt.verify_expiration = False > > def login_take_token(): > return myjwt.jwt_token_manager() > > > @myjwt.allows_jwt() > def call(): > session.forget() > return service() > > @service.run > def myfuncion(nrodoc,sexo): > ... > ... > return data > > > 1°) cuando invoco a > https://www.misitio.com.ar/myapp/webservice/login_take_token?email=usuario&password=12345678 > > I got a token > > 2°) How to use a token in > https://www.misitio.com.ar/myapp/webservice/call/run/myfuncion/41414141 ? > > Thanks in advanced. > >
I think JWT is pretty well documented in gluon/tools.py, and much of that description was posted in the group by Niphlod when he introduced the feature. I would use the comment paragraphs in the code, as the most polished form. I'm not sure that this has been added to the tip revision of the manual yet; I'd think only a little tweaking would be needed for formatting, but I haven't taken the time to do that, and I don't have the experience to refine anything -- I've barely touched JWT so far, as my API is pretty simple. /dps -- 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.

