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

A small webservice for testing a layer client

Notifications You must be signed in to change notification settings

dreimannzelt/layer-token_service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A small webservice for testing a layer client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages