Auth REST API

317 views
Skip to first unread message

yamand...@gmail.com

unread,
Mar 30, 2020, 10:34:02 AM3/30/20
to py4web
I noticed in the documentation there is a rest api for auth and I also have read the sources to get a better idea of what happens.
I can log in with axios through the auth rest api but what I haven't figured out yet is how to keep user authenticated.

My app is being made with quasar, totally decoupled from py4web. The app in py4web is just a backend.
What is a secure way to log in from a front end app to py4web app and keep user authenticated?

For now I am storing user info in localStorage but I think this is too insecure and sensible.
Message has been deleted

valq...@gmail.com

unread,
Apr 3, 2020, 4:54:40 PM4/3/20
to py4web
I use axios like  
axios.create({
              ...,
                            withCredentials: true // does the trick
            })


- works fine

Carlos Costa

unread,
Apr 6, 2020, 9:31:45 AM4/6/20
to valq...@gmail.com, py4web
Thanks!
Do you mean it works with py4web authentication?

--
You received this message because you are subscribed to a topic in the Google Groups "py4web" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/py4web/xrRGdobEqvY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/af30606a-99b2-434f-8ad8-39c460378608%40googlegroups.com.


--
At.

Carlos J. Costa
--------------------------------------------------------------
Cientista da Computação - Esp. Gestão em Telecom

Val K

unread,
Apr 6, 2020, 10:42:32 AM4/6/20
to py4web
Yes, it forces to include session JWT into request


On Monday, April 6, 2020 at 4:31:45 PM UTC+3, Carlos Costa wrote:
Thanks!
Do you mean it works with py4web authentication?

Em sex., 3 de abr. de 2020 às 17:54, <valq...@gmail.com> escreveu:
I use axios like  
axios.create({
              ...,
                            withCredentials: true // does the trick
            })


- works fine

On Monday, March 30, 2020 at 5:34:02 PM UTC+3, yamand...@gmail.com wrote:
I noticed in the documentation there is a rest api for auth and I also have read the sources to get a better idea of what happens.
I can log in with axios through the auth rest api but what I haven't figured out yet is how to keep user authenticated.

My app is being made with quasar, totally decoupled from py4web. The app in py4web is just a backend.
What is a secure way to log in from a front end app to py4web app and keep user authenticated?

For now I am storing user info in localStorage but I think this is too insecure and sensible.

--
You received this message because you are subscribed to a topic in the Google Groups "py4web" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/py4web/xrRGdobEqvY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to py4...@googlegroups.com.

Val K

unread,
Apr 6, 2020, 10:47:27 AM4/6/20
to py4web

I mean this token:



11.png



On Monday, April 6, 2020 at 4:31:45 PM UTC+3, Carlos Costa wrote:
Thanks!
Do you mean it works with py4web authentication?

Em sex., 3 de abr. de 2020 às 17:54, <valq...@gmail.com> escreveu:
I use axios like  
axios.create({
              ...,
                            withCredentials: true // does the trick
            })


- works fine

On Monday, March 30, 2020 at 5:34:02 PM UTC+3, yamand...@gmail.com wrote:
I noticed in the documentation there is a rest api for auth and I also have read the sources to get a better idea of what happens.
I can log in with axios through the auth rest api but what I haven't figured out yet is how to keep user authenticated.

My app is being made with quasar, totally decoupled from py4web. The app in py4web is just a backend.
What is a secure way to log in from a front end app to py4web app and keep user authenticated?

For now I am storing user info in localStorage but I think this is too insecure and sensible.

--
You received this message because you are subscribed to a topic in the Google Groups "py4web" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/py4web/xrRGdobEqvY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to py4...@googlegroups.com.

Carlos Costa

unread,
Apr 6, 2020, 2:37:16 PM4/6/20
to Val K, py4web
Oh, very good! I will try that.
Thanks!

To unsubscribe from this group and all its topics, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/c16aa959-b329-4479-8824-dea8f72515b3%40googlegroups.com.

Carlos A

unread,
Feb 4, 2021, 8:22:38 PM2/4/21
to py4web
Hi Carlos,

Im trying the same as you: app is being made with quasar, totally decoupled from py4web.

Finally, how did you resolve the auth?  Any example to share?

Thank you.

Carlos Costa

unread,
Feb 5, 2021, 5:49:39 AM2/5/21
to Carlos A, py4web
I haven't solved it yet because I left py4web for a while as it was not mature enough to the project I had in mind.
But I plan to come back to it soon and solve those issues.

--
You received this message because you are subscribed to a topic in the Google Groups "py4web" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/py4web/xrRGdobEqvY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to py4web+un...@googlegroups.com.


--
At.

Carlos J. Costa
--------------------------------------------------------------
CTO em Cliex&Co.

Kevin Keller

unread,
Feb 5, 2021, 6:26:15 AM2/5/21
to Carlos Costa, Carlos A, py4web
I also had a long hiatus from using it due to work, but now I found an excuse again to use it for work. 

Feels reasonably mature at this point, but certainly a deviation from web2py. 
Much more flexible and faster, but also harder to figure things out so far. 

I like it still. 

While I am way off on creating a py4web idp from a time perspective, I think I also can come back to write 
2 decorators that can be used to issue a basic JWT and verify that basic JWT. 

Once that works, automatic swagger generation either based on pydal Rest API or xapi from Val would be great. 
Similar to what fastapi does today.
I found this pydal to swagger converter and some point of github.

I posted it in the forum, might be a starting point. 

Would it be useful to restart the weekend chats? 

Has been a while. 

I am happy to do the admin around it as Tom also seems MIA. 

Thanks!



You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/CAGsD4NxsYcAe3WKMWMQNeWmb%2BzygppC6VoEpuhMBW8C0GfYTyw%40mail.gmail.com.

Carlos Costa

unread,
Feb 5, 2021, 6:48:49 AM2/5/21
to Kevin Keller, Carlos A, py4web
That sounds good. I'm interested.

Tito Garrido

unread,
Jun 28, 2021, 1:52:28 PM6/28/21
to Carlos Costa, Kevin Keller, Carlos A, py4web
+1



--

Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______

Dave

unread,
Sep 25, 2021, 11:25:15 PM9/25/21
to py4web
Take a look at this: https://github.com/O2Tk/quasar-py4web
Reply all
Reply to author
Forward
0 new messages