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
app.get('/', stormpath.loginRequired, (req, res, next) => { | |
req.user.uploadFile('./some-file.txt', err => { | |
if (err) return next(err); | |
req.user.getCustomData((err, data) => { | |
if (err) return next(err); | |
res.send('file uploaded as ' + data.s3['package.json'].href); | |
}); | |
}); |
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
'use strict'; | |
const express = require('express'); | |
const stormpath = require('express-stormpath'); | |
const stormpathS3 = require('express-stormpath-s3'); | |
let app = express(); | |
// Middleware here | |
app.use(stormpath.init(app, { |
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
""" | |
import.py | |
~~~~~~~~~ | |
A small script that reads in user accounts from a CSV file, and imports them | |
into Stormpath with a random password. | |
This script requires a few things. | |
First off, it requires the following environment variables to be set: |
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
""" | |
Stormpath OAuth2 Password Grant Authentication Example | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
This example script shows you how to use the Stormpath Python library to | |
authenticate a user via email and password, getting back an access and | |
refresh token. | |
""" | |
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
""" | |
Stormpath OAuth2 Password Grant Authentication Example | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
This example script shows you how to use the Stormpath Python library to | |
authenticate a user via email and password, getting back an access and | |
refresh token. | |
""" | |
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 import Flask, request, jsonify | |
from flask.ext.stormpath import StormpathManager | |
from stormpath.api_auth import BasicRequestAuthenticator | |
app = Flask(__name__) | |
app.config['DEBUG'] = True | |
app.config['STORMPATH_API_KEY_ID'] = 'xxx' | |
app.config['STORMPATH_API_KEY_SECRET'] = 'yyy' | |
app.config['STORMPATH_APPLICATION'] = 'blah' |
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
# This script will build all Sphinx project documentation if, and only if, | |
# an environment variable named `BUILD_DOCS` is present. | |
PWD=`pwd` | |
# First off, we'll find a list of *all* directories which contain a `conf.py` | |
# file. This is the configuration file that Sphinx ships with, so by looking | |
# for this file we can find (for certain) any Sphinx documentation directories | |
# that are inside of this project, even if they're nested in some deep hierarchy. | |
# | |
# NOTE: For OSX you need to modify the sed command to use the -E flag instead of |
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
# This script will install Sphinx for building project documentation if, | |
# and only if, an environment variable named `BUILD_DOCS` is present. | |
test -z "$BUILD_DOCS" || pip --quiet install --user sphinx |
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 import Flask | |
from flask.ext.stormpath import StormpathManager | |
from pydispatch import dispatcher | |
from stormpath.resources.base import SIGNAL_RESOURCE_CREATED | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = 'xxx' | |
app.config['STORMPATH_API_KEY_ID'] = 'xxx' | |
app.config['STORMPATH_API_KEY_SECRET'] = 'xxx' |
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
'use strict'; | |
var express = require('express'); | |
var stormpath = require('express-stormpath'); | |
var app = express(); | |
app.use(stormpath.init(app, { | |
client: { | |
apiKey: { |