Skip to content

Instantly share code, notes, and snippets.

@ohadperry
Created February 8, 2016 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohadperry/f77a26ce758efa2990cb to your computer and use it in GitHub Desktop.
Save ohadperry/f77a26ce758efa2990cb to your computer and use it in GitHub Desktop.
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