more oauth2 fixes

This commit is contained in:
TuxCoder 2023-03-18 12:00:40 +01:00
parent 65ceb2abbd
commit 14d219eef7
7 changed files with 45 additions and 17 deletions

View file

@ -9,9 +9,6 @@ from alembic import op
import sqlalchemy as sa
from flask import current_app
from lenticular_cloud.model import User
from ldap3_orm import AttrDef, EntryBase as _EntryBase, ObjectDef, EntryType
from ldap3_orm import Reader
from ldap3 import Connection, Server, ALL
import logging
@ -23,6 +20,10 @@ depends_on = None
def upgrade():
from ldap3_orm import AttrDef, EntryBase as _EntryBase, ObjectDef, EntryType
from ldap3_orm import Reader
from ldap3 import Connection, Server, ALL
app = current_app
server = Server(app.config['LDAP_URL'], get_info=ALL)
ldap_conn = Connection(server, app.config['LDAP_BIND_DN'], app.config['LDAP_BIND_PW'], auto_bind=True) # TODO auto_bind read docu