-
Notifications
You must be signed in to change notification settings - Fork 6
Running CASI Locally
Harsh Agrawal edited this page Aug 6, 2021
·
1 revision
- Clone the repo
- Find the .env.sample and copy it into a new
.env
file and set the DB URL to any MongoDB database. - Clone the CASIMiddleware repo and follow the steps relevant for your project.
- 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
- Copy the generated private and public keys in the
src/config
directory of CASI. Also, place the public key in the middleware directory. - 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.
- 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. - 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.
- 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.
- Change the localhost URLs from the middleware to the actual
auth.devclub.in
URLs that came with the middleware by default.