Conversation
Using shared secrets, external services can ask for CBRAIN API tokens for users.
|
I will provide precise instructions on how to review/test this new code. |
|
Step 1: when checking out this branch, make sure to run "bundle install" because there are changes in the Gemfile. the "jwt" gem has been upgraded and the "shannon" gem is new. |
|
Step 2. In the rails console, pick a NormalUser of your choice and provide them with a secret: |
|
Step 3: in the console, built yourself a token as if you were "loris": (btw, you can also just use the variable "secret" in the second argument) Copy the resulting string to your clipboard, we'll use it with curl in the next step |
|
Step 4: send the JWT encoded token (the string you got in step 3) to CBRAIN using curl: Curl should print out CBRAIN's answer, a similary JSON output. |
|
Step 5: Check the rails logs and try bad things The rails logs shoudl have lines that say: Now try many other requests by editing the curl command-line you can test once this has worked:
|
Using shared secrets, external services can ask for CBRAIN API tokens for users.