FileCloud API - Authentication Exercise
After you have successfully created a new user and logged in to FileCloud User Site, use this exercise to call the getauthenticationinfo operation.
- You must use the following URL: http://www.yourdomain.com/core/getauthenticationinfo (where www.yourdomain.com is your URL)
- For the purpose of this exercise, Authentication Type must be set to DEFAULT Enabling Default Authentication
In FileCloud, the first fundamental requirement is the ability to identify the FileCloud user uniquely.
- The first time you install FileCloud Server and log in to the Admin Portal, you will have to Create a new FileCloud user account.
- After account creation, you login into the User Portal with that account using the password you created. Log in to the User Portal
- When you login correctly, an authentication cookie is sent back to the browser which is used for all subsequent HTTP calls.
- The client has to pass this cookie back to the server with all the calls going forward to successfully communicate with the FileCloud HTTP server.
- Usually, passing of cookies between client and server is handled automatically in the browser.
- However, if your client does not handle this communication automatically you have to capture and pass this cookie through the HTTP header from the client to the server.
HTTP (GET/POST) response from FileCloud Server will always be in a XML format. FileCloud web server will return the following XML response.
<authenticationinfo> <info> <profile>satad</profile> <displayname>satad</displayname> <peerid>satad</peerid> <authenticated>1</authenticated> <isguestauthenticated>0</isguestauthenticated> <hash>sha1</hash> <guesthash>sha1</guesthash> <guesthashurl/> <isremote>0</isremote> <reasoncode>0</reasoncode> <OS>TONIDO_CLOUD</OS> <authtype>DEFAULT</authtype> </info> </authenticationinfo>
Most of the XML elements above are self explanatory, however do not worry if some properties are not clear. We will dive deep as we go through this document. Let us try to analyze the URL some more. The FileCloud HTTP server expects URL to be of a certain form.
The "CORE" in the above URL refers to FileCloud User Site that provides programmable APIs, manages and provides HTTP connectivity. In our first example, we were using getauthenticationinfo as the operation that gets the basic authentication detail such as profile id, display name, authentication type etc of the profile logged into FileCloud server. The Optional Parameters can be used to pass parameters from client to server. They can either be passed via HTTP Get URL parameters or as POST parameters.