Login or Set Guess Access
Authentication requirements depends on how authentication is configured in Business Analytics:
With Single Sign-On: authentication is handled automatically by the SSO solution. Login is not required and no additional information is needed in requests. With Digital Certificates and SSL: authentication is handled automatically with SSL. Login is not required and no additional information is needed in requests. Anonymous Requests for Guest Access: supply no user credentials, so that Business Analytics treats request as coming from a guest user. To send anonymous requests, include the x-p-anonymous Business Analytics header/parameter in the URL of each request or as an HTTP header. With Basic Credentials: this is the default authentication mechanism when you install Business Analytics. In this case, you must use the REST API method to login to create a Business Analytics session and authenticate the user. You can also use the REST API method to logout. For
Login use this URL:
http://app-server:port/mashzone/edge/api/rest/UserManagerService/login?presto_username=username&presto_password=pw
Both parameters must be in clear text.
For
Logout use this URL:
http://app-server:port/mashzone/edge/api/rest/UserManagerService/logout
Using jQuery, for example, you would login something like this:
jQuery(function() {
var requestBody = '';
jQuery.ajax({
type: "get",
contentType: "application/x-www-form-urlencoded",
url: "/mashzone/edge/api/rest/UserManagerService/login?x-presto-resultFormat=json&presto_username=
userA&presto_password=pwA",
data: requestBody,
dataType: "text",
success: function(response){
var result = response;
if(typeof response !== "string") {
result = Object.toJSON(response);
}
//handle success
},
error: function(xhr, errorStatus, e) {
//handle error
}
});
});