-
Notifications
You must be signed in to change notification settings - Fork 9
Getting Started
jmiranda edited this page Sep 8, 2014
·
1 revision
See README.md.
- Log into the CATCH dashboard (http://localhost:8080/catch/dashboard/index).
- The default username is admin, default password: password.
- Click on the Create System link.
- Enter a name (e.g. Sample Client), short name (e.g. sample-client) and description (include URL of the client if it exists).
- Click the Save System button.
- Copy the API Key.
Every request made to the API needs a valid JSON Web Token. This token can be generated in various ways. Here's one way that I have found to generate a quick JWT to use for testing. The actual annotatorjs client should be able to generate a JWT dynamically. See the following documentation for more information (http://docs.annotatorjs.org/en/latest/authentication.html).
- Go to http://openidtest.uninett.no/jwt
- Copy the following JWT Claims into the Unpacked JWT textarea. Use the API key that you copied after creating a new System in the previous step. The username should be the email of the user sending the request.
- Click the Encode button to generate your JWT.
- Copy the value in the Encoded JWT textarea.
Example Unpacked JWT
{
"userId": "<username>",
"consumerKey": "<api-key>",
"ttl": 86400,
"issuedAt": "2014-09-08T17:28:30+00:00"
}
Example Encoded JWT
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiJqbWlyYW5kYSIsImNvbnN1bWVyS2V5IjoiNWE1YjU5NzEtMWJmYy00ZTliLTg5NDItMDlhYzQzOTIyYTQ0IiwidHRsIjo4NjQwMCwiaXNzdWVkQXQiOiIyMDE0LTA5LTA4VDE3OjI4OjMwKzAwOjAwIiwidHlwIjoiSldUIn0.bUPKYZdt4lHBsnR-8glGEPqWsMwKwAhupl9Q_OHvzdE
- You can also verify the token by decoding the JWT string from above on the following page (https://developers.google.com/wallet/digital/docs/jwtdecoder).
- Copy your newly generated JWT string into the textarea.
- Click the Decode JWT button.
- You should see the same Claims that you entered above.
Header
{
"alg": "HS256",
"typ": "JWT"
}
Claims
{
"issuedAt": "2014-09-08T17:28:30+00:00",
"typ": "JWT",
"consumerKey": "5a5b5971-1bfc-4e9b-8942-09ac43922a44",
"userId": "jmiranda",
"ttl": 86400
}
Signature (encoded)
bUPKYZdt4lHBsnR-8glGEPqWsMwKwAhupl9Q_OHvzdE