Created
February 8, 2016 08:57
-
-
Save ohadperry/f77a26ce758efa2990cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask.ext.stormpath import login_required | |
from flask.ext.stormpath import StormpathManager | |
from flask.ext.stormpath import user | |
from flask.ext.stormpath import groups_required | |
from flask.ext.stormpath import groups_required | |
from flask.ext.stormpath import User as StormpathUser | |
from flask.ext.login import login_user | |
...... | |
#stormpath configs | |
app.config['STORMPATH_ENABLE_GOOGLE'] = True | |
app.config['STORMPATH_SOCIAL'] = { | |
'GOOGLE': { | |
'client_id': GOOGLE_WEB_CLIENT_ID, | |
'client_secret': GOOGLE_CLIENT_SECRET, | |
} | |
} | |
app.config['STORMPATH_API_KEY_ID'] = STORMPATH_CLIENT_APIKEY_ID | |
app.config['STORMPATH_API_KEY_SECRET'] = STORMPATH_CLIENT_APIKEY_SECRET | |
app.config['STORMPATH_APPLICATION'] = 'backoffice' | |
app.config['STORMPATH_LOGIN_TEMPLATE'] = 'users/login.html' | |
# session expiry time - 30 minutes | |
app.config['STORMPATH_COOKIE_DURATION'] = timedelta(minutes=30) | |
stormpath_manager = StormpathManager(app = app) | |
# stormpath_manager.init_app(app) | |
# todo get main cloud directory | |
# stormpath_manager.client.directories.search({'name': 'Main Cloud Directory'}) | |
stormpath_helper = StormpathHelper(stormpath_manager, StormpathUser) | |
app.stormpath_helper = stormpath_helper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment