MashZone NextGen 10.2 | Appendix | Legacy Presto components | MashZone NextGen Development and APIs | Working with theMashZone NextGenREST API | Login or Set Guess Access
 
Login or Set Guess Access
Authentication requirements depends on how authentication is configured in MashZone NextGen:
*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 MashZone NextGen treats request as coming from a guest user. To send anonymous requests, include the x-p-anonymous MashZone NextGen 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 MashZone NextGen. In this case, you must use the REST API method to login to create a MashZone NextGen 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
}
});
});

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release