Skip to content

Running CASI Locally

Harsh Agrawal edited this page Aug 6, 2021 · 1 revision

Steps to run CASI locally.

  1. Clone the repo
  2. Find the .env.sample and copy it into a new .env file and set the DB URL to any MongoDB database.
  3. Clone the CASIMiddleware repo and follow the steps relevant for your project.
  4. The middleware will require a public key for CASI. You can generate a public and private key pair using the following commands in a terminal
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
  1. Copy the generated private and public keys in the src/config directory of CASI. Also, place the public key in the middleware directory.
  2. Run the CASI server and register a dummy account that you can use for testing. When in development mode user verification is not required so you can directly login using the email and password of the dummy account.
  3. If you want to test admin endpoints then manually edit the roles field of your account in the DB and add the role admin to the list.
  4. Configure the middleware options and set the URLs to localhost URLs instead of auth.devclub.in URLs in the middleware code.

If you have followed all the steps above then you should be ready to test the middleware with CASI. Start your server and the CASI server on different ports and try to first sign in to CASI and then in your app to see if everything works.

Things to do after local testing.

  1. Replace the test keys that you generated for CASI with the actual CASI public key. You can ask your coordinator to provide them or if you are already privileged then you can access the public key here.
  2. Change the localhost URLs from the middleware to the actual auth.devclub.in URLs that came with the middleware by default.
Clone this wiki locally