Skip to content
A small webservice for testing a layer client
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Gemfile
Gemfile.lock
README.md
app.json
app.rb
config.ru

README.md

Layer TokenService

This small Sinatra app implements a basic webservice for testing your Layer client. Just click the button below and deploy this webservice to Heroku:

Deploy

Configuration

If you click on the Heroku Deploy button all mandatory variables you need will be shown. You can set these variables via command line afterwards:

heroku config:set LAYER_PROVIDER_ID=provider_id LAYER_KEY_ID=key_id LAYER_PRIVATE_KEY="some real long and multiline RSA super key"

For all other deployment methods (or testing it locally) just set the appropriate variables

LAYER_PROVIDER_ID=provider_id 
LAYER_KEY_ID=key_id 
LAYER_PRIVATE_KEY="some real long and multiline RSA super key"

Usage

curl -X "POST" "http://your-new-app.herokuapp.com/hello/layer" \
  -d "user_id=1" \
  -d "nonce=2"

This will be your response:

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyIsImN0eSI6ImxheWVyLWVpdDt2PTEiLCJraWQiOiJmNmM0OGNjZS1jZDY3LTExZTQtYTM4NC1lYWU4YzEwMDEwYWEifQ.eyJpc3MiOiI5ZTM2OTc4NC05OGFlLTExZTQtYjYyNy03NWJkMDAwMDAwZTYiLCJwcm4iOiIiLCJpYXQiOjE0MjY4ODM1MzksImV4cCI6MTQyODA5MzEzOSwibmNlIjpudWxsfQ.GYawDvYhR0ygV5e7BQOaPBKUkXZsj5rHtePV2UcwObUHIGRajzuOlDHcamdw"
}

Credits

Thanks to @layer for this awesome service.
Webservice brought to you by @dreimannzelt, ©2015

You can’t perform that action at this time.