Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Latest commit

 

History

History
44 lines (29 loc) · 1.43 KB

README.md

File metadata and controls

44 lines (29 loc) · 1.43 KB

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