Skip to content

Latest commit

 

History

History
37 lines (20 loc) · 852 Bytes

File metadata and controls

37 lines (20 loc) · 852 Bytes

jwt-sinatra-example

JSON Web Token authentication in sinatra example app

Helpful articles about JSON Web Token and ruby:

http://www.intridea.com/blog/2013/11/7/json-web-token-the-useful-little-standard-you-haven-t-heard-about

Built using:

Sinatra

ruby-jwt

To get started with this project

Clone this repo and run bundle

To start the sinatra server:

from jwt-sinatra-example/

ruby app.rb

You should see sinatra fire up with Webrick. Point your web browser to:

http://localhost:4567/

This app will load app.rsa and app.rsa.pub as sign and verify keys for the JWT encode and decode

the app.rsa and app.rsa.pub were generated with:

openssl genrsa -out app.rsa 2048

openssl rsa -in app.rsa -pubout > app.rsa.pub