Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flask authentication using LDAP

Tags:

python

flask

ldap

I've searched an answer for this but have found nothing - maybe because it's so obvious. But I want to make sure.

What is the correct way to authenticate users using an LDAP server in a Flask web app?

This link describes 4 authentication methods, so along the same lines, do I just need to write an LDAP auth decorator?

(The reason I'm asking is to see whether I can make a Flask clone of my Django app)

Thanks for any help and suggestions.

like image 442
reckbo Avatar asked Jul 19 '11 14:07

reckbo


1 Answers

Yes, you have to write your own decorator which checks the authentication.

In this decorator you should call the wrapped function if a user is authenticated. If not you should return a default page reminding the user to login.

like image 59
schlamar Avatar answered Sep 24 '22 00:09

schlamar