There are two mechanisms for authenticating to Handcar. One uses MIT’s Touchstone to perform the authentication the other uses AGENT KEYS. Each has it’s own URL.
It depends on how you are going to build and deploy your application.
These use cases describe the different scenarios that we expect to encounter. We distinguish between whether the the HTTP request comes from the same server that hosts the Handcar service, or a server remote from the Handcar host server.
` <#>`__` <#>`__
Different server than handcar
Same server as Handcar
Only Server calls handcar
Scenario 1
Scenario 3
Browser client makes AJAX calls directly to handcar
Scenario 2
Scenario 4
Scenario one describes an application server that manages MC3 data directly on behalf of a user
Scenario 5 – application is a browser extension and has access to cross-domain cookies
For FireFox and Chrome browsers, extensions have access to cross-domain cookies. This allows them to authenticate the user against a Touchstone-enabled server (i.e. running handcar-authn), and then have authenticated communications with an MC3 service. The MC3 Browser Extension is one example of this.
If your application will run on the same server as handcar you don’t have to do anything. We will configure your application to work with touchstone. If your application will run on a different server then it is a more complicated process. You need to work with MIT’s touchstone people and the process involves creating and exchanging certificates.
The url is https://mc3-demo.mit.edu/handcar-authn/services/learning/
Note the “handar-authn” in the above url. This url has been configured to required the user to log in via Touchstone.
When you access handcar via this URL it redirects you to the Touchstone login site. Once authenticated it includes in your HTTP requests special “cookies” that authenticate you to the handcar service.
They can access it as a guest, MC3GUE$T, but are limited to those authorizations, (see below). Currently only users with full MIT credentials (Kerberos ids) can access MC3 fully. This is a limitation of the MIT Roles database which only accepts fully credentialed users.
No. Since these are not fully credentialed they cannot be granted any authorizations in the roles database so they cannot access the system as anything but as a guest.
When you go to the learning service via this URL https://mc3-demo.mit.edu/handcar/services/learning/ it has configured to allow in any users to connect to the service as a GUEST “MC3GUE$T”. Handcar then uses “agent keys” or tokens to identify users and grant access to it’s resources. If you do not have any keys then you can enter only as a guest. (see below). Each agent key encodes and encrypts two things:
They are all prefixed by “AGENT_KEY” followed by a long string of gibberish, for example:
AGENT_KEYS6joWZkxqzi5H3Mu3ULGfviSF92D7BO2oRkaFo0VL1LXTQ6X2qbHgX6VQ4wEn%2BIX
This is the key hrm%40.mit.edu that expired about an hour before I wrote this so using this key SHOULD NOT work.
The token is created based on a secret encryption key that varies by which server you are using. Therefore you might need three different keys:
By default an agent key will expire 1 hour after it is issued. After that you will have to get a new one.
TODO: Change handcar to automatically extend the expiration date to 15 minutes after last access.
When the key is generated you can optionally request it a longer duration.
==> Warning: the keys are not saved permanently to disk so they will get trashed if we have to recycle the server and become unusable even if the expiration date has not passed.
No only a handful of authorized people and applications can construct these keys..
Yes applications themselves can have their own key and can be configured to construct a key on behalf of a user. That is why it is called an “agent key” and not just a “user key”. Applications are often authorized agents that can access the system to construct keys on behalf of a real user who has logged into their application.
The sequence goes something like this:
If the application is going to run on the same physical server as Handcar you don’t need one. Touchstone authentication reaches across the application boundaries.
If you do need an application key please contact handcar-help@mailman.mit.edu
We can also configure permanent keys with a fixed expiration date at some point in the future, for example new years eve, 2013-12-31. This is done on a case by case basis. In general only applications get these quasi permanent keys but some power users have them as well.
==> Since this key needs to be kept SECRET it is dangerous to have it last so long.
Note: These keys DO survive reboots of the server because they are persisted each time from a hidden set of properties files.
If you want to make an authenticated request you put the agent key into the optional “proxyname” query parameter
?proxyname=AGENT_KEYS6joWZkxqzi5H3Mu3ULGfviSF92D7BO2oRkaFo0VL1LXTQ6X2qbHgX6VQ4wEn%2BIX
https://mc3-demo.mit.edu/handcar/services/authentication/agentkeys/nwright
TODO: construct a curl example
TODO: construct a curl example