Skip to main content

Ruby on Rails

Setup

Clone the server

Start by cloning the server repository from GitHub. You can do this by running the following command:

git clone https://github.com/aserto-demo/todo-ruby-v2

Install dependencies

To install the application dependencies, run the following command:

cd todo-ruby-v2
bundle install

Set up an .env file

Copy the .env.example file to .env and update the ASERTO_AUTHORIZER_CERT_PATH and ASERTO_DIRECTORY_GRPC_CERT_PATH to correspond to the path in which Topaz generated your certificates (by default this path will be $HOME/.local/share/topaz/certs/grpc-ca.crt, or $HOME\AppData\Local\topaz\certs on Windows).

cp .env.example .env

Your .env file should look like:

JWKS_URI=https://citadel.demo.aserto.com/dex/keys
ISSUER=https://citadel.demo.aserto.com/dex
AUDIENCE=citadel-app

ASERTO_POLICY_ROOT="todoApp"

ASERTO_AUTHORIZER_SERVICE_URL=localhost:8282
ASERTO_AUTHORIZER_CERT_PATH=$HOME/.local/share/topaz/certs/grpc-ca.crt
ASERTO_DIRECTORY_SERVICE_URL=localhost:9292
ASERTO_DIRECTORY_GRPC_CERT_PATH=$HOME/.local/share/topaz/certs/grpc-ca.crt

Run the DB migration

bundle exec rails db:migrate

Start the server

bundle exec rails server

Next steps

Test your server by using the sample web Todo application.