Skip to content
Browse files

Replacing Flask-Security with Flask-Security-Fork. Removing some expl…

…icit dependencies to rely on flask-security-fork dependencies. SSO will use flask-security login_user instead of flask-login so that security_trackable works. Replacing current_user.is_authenticated() method with property so we can use a newer version of flask-login. (#482)
  • Loading branch information...
Patrick Kelley
Patrick Kelley committed Dec 30, 2016
1 parent da8c81e commit 3b4da13efabb05970c80f464a50d3c1c12262466
@@ -240,7 +240,7 @@ def _check_permission(self, roles, method, resource):

def _deny_hook(self, resource=None):
app = self.get_app()
if current_user.is_authenticated():
if current_user.is_authenticated:
status = 403
status = 401
@@ -250,7 +250,7 @@ def _deny_hook(self, resource=None):
url = "https://{}:{}{}".format(app.config.get('FQDN'), app.config.get('NGINX_PORT'), '/login')
url = "http://{}:{}{}".format(app.config.get('FQDN'), app.config.get('API_PORT'), '/login')
if current_user.is_authenticated():
if current_user.is_authenticated:
auth_dict = {
"authenticated": True,
@@ -13,7 +13,7 @@

from flask.ext.restful import reqparse, Resource, Api
from flask.ext.principal import Identity, identity_changed
from flask_login import login_user
from flask_security.utils import login_user

from onelogin.saml2.auth import OneLogin_Saml2_Auth
@@ -264,7 +264,7 @@ def _consumer(self, auth):
errors = auth.get_errors()
if not errors:
if auth.is_authenticated():
if auth.is_authenticated:
return True
return False
@@ -144,7 +144,7 @@ def __init__(self):
self.reqparse = reqparse.RequestParser()
super(AuthenticatedService, self).__init__()
self.auth_dict = dict()
if current_user.is_authenticated():
if current_user.is_authenticated:
roles_marshal = []
for role in current_user.roles:
roles_marshal.append(marshal(role.__dict__, ROLE_FIELDS))
@@ -25,7 +25,7 @@ class Logout(Resource):
decorators = [rbac.exempt]

def get(self):
if not current_user.is_authenticated():
if not current_user.is_authenticated:
return "Must be logged in to log out", 200

@@ -23,25 +23,24 @@
# 'Flask-Security==1.7.4',

0 comments on commit 3b4da13

Please sign in to comment.
You can’t perform that action at this time.