Re: [web2py] Re: RESTful service with access control

2019-05-14 Thread Jim S
Yes, I have the view set. I have it working now if I use the password stored in my auth_user table. But, I'd really prefer to have it go through all available authentication methods to authenticate a user. We have some users that authenticate to our mail server and others that use the

Re: [web2py] Re: RESTful service with access control

2019-05-14 Thread Jim Steil
Massimo - thanks for that info. This won't help in my case as I'm using the RESTful API to get access to another of my server-side python packages. But, I can see the power of the DBAPI. I'm waiting for you to stabilize web3py before I jump in. I'd love to get involved in more testing but I

[web2py] Re: RESTful service with access control

2019-05-14 Thread Massimo Di Pierro
You may want to see my other post about the new policy based DBAPI. On Monday, 13 May 2019 09:28:11 UTC-7, Jim S wrote: > > Hi > > I'm setting up a REST service that requires authentication. I'm following > the example here: > >

Re: [web2py] Re: RESTful service with access control

2019-05-13 Thread Val K
One yet important moment: Do you set the view for your api? I mean, that book example will not work without response.view='generic.json' if request is not local. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: RESTful service with access control

2019-05-13 Thread Jim Steil
Val I just created a test app based on the code in the book and all is working as it should. Must be something else in my other app that is causing the trouble. I'll check it out later. Also looking into JWT... On Mon, May 13, 2019 at 8:38 PM Jim Steil wrote: > Val > > Thanks so much for

Re: [web2py] Re: RESTful service with access control

2019-05-13 Thread Jim Steil
Val Thanks so much for the references. However, I'm really a bit lost. Using login_bare()?? Where does that come in to play? And then a custom decorator? Am I doing something wrong that is preventing the sample in the book from working? Not sure why mine is just redirecting. Any samples

[web2py] Re: RESTful service with access control

2019-05-13 Thread Val K
There is also https://github.com/web2py/web2py/blob/master/gluon/authapi.py -- 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

[web2py] Re: RESTful service with access control

2019-05-13 Thread Val K
For services I use auth.login_bare(u,p) and handmade decorator based on auth.is_logged_in() - don't forget about parens! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: RESTful service with access control

2019-05-13 Thread Jim S
Shoot, looks like my initial testing wasn't even working. I was just checking the status code which was returning 200, but didn't realize it was redirecting me to the login page. Any way i can stop that? -Jim On Monday, May 13, 2019 at 11:51:27 AM UTC-5, Val K wrote: > > As far as I