Tutorials

Authenticate with ruby / sinatra

1Get public key

Download the public key and move it to your project directory.

Get Public Key

2Install dependencies

First, install the required gems for Sinatra, JWT handling, and OpenSSL.

3Create the auth.rb file

In this step, create a separate file for JWT verification using RS256.

4Create the app.rb file

Create the main Sinatra app file with API endpoints for authenticated and unauthenticated users.

5Run the Sinatra app

Run the Sinatra application locally.