Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python /Flask Login with LDAP Auth
#1
I have Python/Flask application with a login screen. My goal is to utilize LDAP authentication in unison with my Python/Flask app.

The issue that i am running into is this: " raise RuntimeError('The session is unavailable because no secret ' RuntimeError: The session is unavailable because no secret key was set. Set the secret_key on the application to something unique and secret." I have a secret key and i still get the error same error when i comment it out.

Here is my code:
import token
from flask import Flask, session
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager

app = Flask(name)
app.secret_key = 'welfhwdlhwdlfhwelfhwlehfwlehfelwehflwefwlehflwefhlwefhlewjfhwelfjhweflhweflhwel'
app.config['SESSION_TYPE'] = 'filesystem'
app.config['LDAP_AUTH_SERVER'] = 'LDAPLocation.com'
app.config['LDAP_PORT'] = '636'
app.config['LDAP_TOP_DN'] = 'CN=something here,OU=somethingHere,OU=SomeService Accounts,dc=magic,dc=pumpum,DC=com Xe'
app.config['LDAP_BIND_USER_PASSWORD'] = 'pssword'
app.register_blueprint(token, url_prefix='/auth')

db = SQLAlchemy(app)

login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'

from app.auth.views import auth

app.register_blueprint(auth)

Thank you in advance....
Reply


Messages In This Thread
Python /Flask Login with LDAP Auth - by pythonnubie - Apr-13-2018, 04:04 PM
RE: Python /Flask Login with LDAP Auth - by nilamo - Apr-13-2018, 09:01 PM
RE: Python /Flask Login with LDAP Auth - by nilamo - Apr-16-2018, 03:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Flask login help dangermaus33 0 1,609 Dec-07-2020, 04:06 PM
Last Post: dangermaus33
  python 3.7 on windows using flask and flask-sqlalchemy. Alpy 2 4,016 Aug-12-2020, 07:24 PM
Last Post: Alpy
  Python Webscraping with a Login Website warriordazza 0 2,609 Jun-07-2020, 07:04 AM
Last Post: warriordazza
  [Flask]After login page is not redirecting me to dashboard shockwave 0 2,714 May-07-2020, 05:22 PM
Last Post: shockwave
  How to perform a successful login(signin) through Requests in Python Kalet 1 2,354 Apr-24-2020, 01:44 AM
Last Post: Larz60+
  Google calendar pthon flask auth Kireta 0 2,103 Sep-16-2019, 04:50 PM
Last Post: Kireta
  Python-selenium script for automated web-login does not work hectorKJ 2 4,087 Sep-10-2019, 01:29 PM
Last Post: buran
  HOWTO? Login DSL Modem with Python Requests: need Click "Apply" Button Webtest 4 8,508 Aug-20-2019, 04:03 PM
Last Post: johnmina
  Flask tutorial errors in jinja, auth undefined Ecniv 2 2,529 May-03-2019, 02:04 PM
Last Post: Ecniv
  Problem enabling http auth in a route nikos 2 2,820 Mar-02-2019, 01:13 PM
Last Post: nikos

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020