Apr-13-2018, 04:04 PM
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....
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....