Authentication SocioCortex

Authentication

While SocioCortex allows anonymous access to its resources, you have to be authenticated to access protected resources and to edit the content of SocioCortex.

Right now, SocioCortex only supports basic authentication. Therefore, you have to concate your username, a colon (‘:’), and your password, perform a Base64-encoding, append the prefix ‘Basic ‘, and add it as the value of the ‘Authorization’ header to the HTTP request. The header for username ‘sociocortex.sebis@tum.de’ and password ‘sebis’ would look like follows:

Authorization:  Basic c29jaW9jb3J0ZXguc2ViaXNAdHVtLmRlOnNlYmlz

To authenticate the requests when using sc-angular, use the scAuth service to store your credentials once (within the browser):

    
	scAuth.login('sociocortex.sebis@tum.de', 'sebis');

	// The following request already uses the stored credentials
	scData.Workspace.query().then(function (workspaces) {
	for (var i = 0; i < workspaces.length; i++) {
		console.log(workspaces[i].name);
	}
});
    
    

All requests performed by sc-angular will implicitly use those credentials.