- User Goals API repo: https://github.com/3scale/3scale-workshop
- Heroku One Click Deploy 3scale API Gateway repo: https://github.com/3scale/oneclick-api-gateway-heroku
- Admin dashboard: https://{YOUR_SUBDOMAIN}-{EVENT_NAME}-admin.3scale.net - e.g https://3scale-apistrat-admin.3scale.net
- Developer Portal: https://{YOUR_SUBDOMAIN}-{EVENT_NAME}.3scale.net - e.g https://3scale-nordicapis.3scale.net
curl -u :`heroku auth:token` -H 'Accept: application/vnd.heroku+json; version=3' -X POST -d '
{
"source_blob": {
"url": "https://github.com/3scale/oneclick-api-gateway-heroku/tarball/master"
},
"app": {
"stack": "cedar"
},
"overrides": {
"env": {
"BUILDPACK_URL": "http://github.com/leafo/heroku-buildpack-lua.git",
"THREESCALE_DEPLOYMENT_ENV": "heroku-api",
"THREESCALE_PROVIDER_KEY": "YOUR_PROVIDER_KEY",
"THREESCALE_ADMIN_DOMAIN": "YOUR_ADMIN_DOMAIN"
}
}
}
' https://api.heroku.com/app-setups
You can then run, as for the API deployment to check when your application is deployed:
curl -n -X GET https://api.heroku.com/app-setups/YOUR_DEPLOY_ID -H "Accept: application/vnd.heroku+json; version=3"
Once that's succesfully deployed, you can try making some calls on your API through the gateway, e.g
curl -v -X GET https://YOUR-HEROKU-API-GATEWAY.herokuapp.com/api/meals.json?user_key=YOUR_USER_KEY
- OAuth Gateway github repo: https://github.com/mpguerra/user-goals-oauth-api-gateway
- OAuth Gateway : http://user-goals-oauth-api-gateway.herokuapp.com/
Pre-reqs: heroku toolbelt installed
###Set up
- Clone OAuth Gateway repo:
git clone git@github.com:mpguerra/user-goals-oauth-api-gateway.git
heroku apps:create --buildpack http://github.com/leafo/heroku-buildpack-lua.git <APPLICATION_NAME>
heroku addons:add redistogo
heroku addons:add threescale
heroku addons:open threescale
- Get service_id and set environment variable
heroku config:set THREESCALE_SERVICE_ID=<SERVICE_ID>
- Change auth mode to OAuth
- Create new developer account and set application's redirect url to:
https://www.getpostman.com/oauth2/callback
git push heroku master
- Get access token using POSTMAN
- Get user data for user identified by access token
- Heroku Toolbelt: https://toolbelt.heroku.com/
To get a list of sample users:
heroku run console
require './application'
User.all
To log in as a user:
- take username from call above
- password is 'password'
To get a list of all tokens assigned to an application:
curl -X GET "http://su1.3scale.net/services/<SERVICE_ID>/applications/<CLIENT_ID>/oauth_access_tokens.xml?provider_key=<PROVIDER_KEY>"