Tutorials

Authenticate with crystal / kemal

1Get public key

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

Get Public Key

2Create the shard.yml file

Create the shard.yml file with required dependencies for Kemal, JWT handling, and OpenSSL.

3Install dependencies

Install the required packages using the shard.yml configuration file.

4Create the auth.cr file

Create a separate file for JWT verification with RS256 using the public key.

5Create the main.cr file

Create the main Kemal app file with routes for authenticated and unauthenticated users.

6Run the Kemal app

Run the application locally using Kemal.