librelist archives

« back to archive

Where to put code to authenticate a flask webapp with twitter app

Where to put code to authenticate a flask webapp with twitter app

From:
h.benoudjit
Date:
2014-09-26 @ 09:48
Hi,
I have a mini web app made with flask that try to authenticate with a 
twitter app.
should I put the code that authenticated inside before_request (as with 
db connection) or just inside before_first_request?

thanks!

-- 
Best regards,
Hakim Benoudjit

Re: [flask] Where to put code to authenticate a flask webapp with twitter app

From:
David Baumgold
Date:
2014-09-26 @ 13:13
You might want to check out Flask-Dance, which makes it easy to 
authenticate with Twitter and other OAuth providers: 
https://github.com/singingwolfboy/flask-dance

If you have any feedback, I’d love to hear it!  


On Friday, September 26, 2014 at 5:48 AM, h.benoudjit wrote:

> Hi,
> I have a mini web app made with flask that try to authenticate with a  
> twitter app.
> should I put the code that authenticated inside before_request (as with  
> db connection) or just inside before_first_request?
>  
> thanks!
>  
> --  
> Best regards,
> Hakim Benoudjit
>  
>  

Re: [flask] Where to put code to authenticate a flask webapp with twitter app

From:
Hakim Benoudjit
Date:
2014-09-26 @ 19:42
Thanks I'll try.
But if I don't want to add another dependency, or for an api that doesn't
use oauth (in general),
where should the authentication code be placed?

2014-09-26 14:13 GMT+01:00 David Baumgold <david@davidbaumgold.com>:

> You might want to check out Flask-Dance, which makes it easy to
> authenticate with Twitter and other OAuth providers:
> https://github.com/singingwolfboy/flask-dance
>
> If you have any feedback, I’d love to hear it!
>
> On Friday, September 26, 2014 at 5:48 AM, h.benoudjit wrote:
>
> Hi,
> I have a mini web app made with flask that try to authenticate with a
> twitter app.
> should I put the code that authenticated inside before_request (as with
> db connection) or just inside before_first_request?
>
> thanks!
>
> --
> Best regards,
> Hakim Benoudjit
>
>
>


-- 
Cordialement,
Best regards,
Hakim Benoudjit