mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-10 07:30:26 +00:00
raised password length to 30 for external accounts.
fixed error_checking for saml-authentication
This commit is contained in:
parent
12c957bf5f
commit
baa960aad6
@ -202,8 +202,7 @@ def saml_authorized():
|
|||||||
req = utils.prepare_flask_request(request)
|
req = utils.prepare_flask_request(request)
|
||||||
auth = utils.init_saml_auth(req)
|
auth = utils.init_saml_auth(req)
|
||||||
auth.process_response()
|
auth.process_response()
|
||||||
attributes = auth.get_attributes();
|
errors = auth.get_errors()
|
||||||
not_auth_warn = not auth.is_authenticated()
|
|
||||||
if len(errors) == 0:
|
if len(errors) == 0:
|
||||||
session['samlUserdata'] = auth.get_attributes()
|
session['samlUserdata'] = auth.get_attributes()
|
||||||
session['samlNameId'] = auth.get_nameid()
|
session['samlNameId'] = auth.get_nameid()
|
||||||
@ -216,7 +215,7 @@ def saml_authorized():
|
|||||||
if not user:
|
if not user:
|
||||||
# create user
|
# create user
|
||||||
user = User(username=session['samlNameId'],
|
user = User(username=session['samlNameId'],
|
||||||
plain_text_password=gen_salt(7),
|
plain_text_password=gen_salt(30),
|
||||||
email=session['samlNameId'])
|
email=session['samlNameId'])
|
||||||
user.create_local_user()
|
user.create_local_user()
|
||||||
session['user_id'] = user.id
|
session['user_id'] = user.id
|
||||||
@ -226,7 +225,7 @@ def saml_authorized():
|
|||||||
user.firstname = session['samlUserdata']["givenname"][0]
|
user.firstname = session['samlUserdata']["givenname"][0]
|
||||||
if session['samlUserdata'].has_key("surname"):
|
if session['samlUserdata'].has_key("surname"):
|
||||||
user.lastname = session['samlUserdata']["surname"][0]
|
user.lastname = session['samlUserdata']["surname"][0]
|
||||||
user.plain_text_password = gen_salt(7)
|
user.plain_text_password = gen_salt(30)
|
||||||
user.update_profile()
|
user.update_profile()
|
||||||
session['external_auth'] = True
|
session['external_auth'] = True
|
||||||
login_user(user, remember=False)
|
login_user(user, remember=False)
|
||||||
@ -255,7 +254,7 @@ def login():
|
|||||||
if not user:
|
if not user:
|
||||||
# create user
|
# create user
|
||||||
user = User(username=user_info['name'],
|
user = User(username=user_info['name'],
|
||||||
plain_text_password=gen_salt(7),
|
plain_text_password=gen_salt(30),
|
||||||
email=user_info['email'])
|
email=user_info['email'])
|
||||||
user.create_local_user()
|
user.create_local_user()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user