Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nickdufresne/jwt-sinatra-example
JSON Web Token authentication in sinatra example app
https://github.com/nickdufresne/jwt-sinatra-example
Last synced: 3 months ago
JSON representation
JSON Web Token authentication in sinatra example app
- Host: GitHub
- URL: https://github.com/nickdufresne/jwt-sinatra-example
- Owner: nickdufresne
- Created: 2014-08-21T14:57:18.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T21:02:37.000Z (7 months ago)
- Last Synced: 2024-05-21T04:32:04.548Z (6 months ago)
- Language: Ruby
- Size: 204 KB
- Stars: 37
- Watchers: 4
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](http://www.sinatrarb.com)
[ruby-jwt](https://github.com/progrium/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`