Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flask_sso.SSOAttributeError #25

Open
zurgeg opened this issue Feb 29, 2020 · 1 comment
Open

flask_sso.SSOAttributeError #25

zurgeg opened this issue Feb 29, 2020 · 1 comment

Comments

@zurgeg
Copy link

zurgeg commented Feb 29, 2020

Whenever I run my code the code from the Docs it gives me this:

flask_sso.SSOAttributeError

My code is

from flask import Flask, session, redirect
from flask_sso import SSO
app = Flask(__name__)
sso = SSO(app=app)
SSO_ATTRIBUTE_MAP = {
    'ADFS_AUTHLEVEL': (False, 'authlevel'),
    'ADFS_GROUP': (True, 'group'),
    'ADFS_LOGIN': (True, 'nickname'),
    'ADFS_ROLE': (False, 'role'),
    'ADFS_EMAIL': (True, 'email'),
    'ADFS_IDENTITYCLASS': (False, 'external'),
    'HTTP_SHIB_AUTHENTICATION_METHOD': (False, 'authmethod'),
}

app.config['SSO_ATTRIBUTE_MAP'] = SSO_ATTRIBUTE_MAP
@sso.login_handler
def login_callback(user_info):
    """Store information in session."""
    session['user'] = user_info
@app.route('/')
def index():
    """Display user information or force login."""
    if 'user' in session:
        return 'Welcome {name}'.format(name=session['user']['nickname'])
    return redirect(app.config['SSO_LOGIN_URL'])
app.run(host='0.0.0.0')

Can anyone help?
Thanks in advance.

@lnielsen
Copy link
Member

Unfortunately, the project is unmaintained for quite some time now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants