package com.AS400; import com.ibm.as400.access.AS400Message; import com.ibm.as400.access.CommandCall; import com.ibm.as400.access.FTP; import org.apache.commons.net.ftp.FTPSClient; import org.json.JSONObject; import org.json.simple.parser.JSONParser; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.sql.ResultSet; import java.sql.Statement; import java.text.SimpleDateFormat; import java.util.*; import java.util.logging.Logger; import org.apache.commons.codec.binary.Base64; public class AS400CS { final static Logger logger = Logger.getLogger(AS400CS.class.getName()); public static void main(String[] args) { // TODO Auto-generated method stub String url = "10.254.48.233"; String userName = "SAVIYNTDEV"; String password = "Y*!8QnpQUJW"; try { /*com.ibm.as400.access.AS400 as4 = new com.ibm.as400.access.AS400(url, userName, password); as4.setGuiAvailable(false); System.out.println("connection successful"); boolean result = false; CommandCall commandCall = new CommandCall(as4); commandCall.setCommand("FNDSTRPDM STRING('DERP') FILE(TSTLIB/QRPGLESRC) MBR(*ALL) OPTION(*NONE) PRTMBRLIST(*YES)"); result = commandCall.run(); System.out.println("Result " + result); AS400Message[] messageList = commandCall.getMessageList(); for (int i = 0; i < messageList.length; ++i) { System.out.println(messageList[i].getText()); } */ /* HashMap hm = new HashMap(); hm.put("connect_url","augusta.rccl.com"); hm.put("connect_username","SAVIYNT"); hm.put("connect_password","VM2F7AHPXO111"); hm.put("accountName","atulvij"); hm.put("taskType","3"); hm.put("taskid","14"); hm.put("entitlementname","USER"); hm.put("groupprofile","PKSOPS"); hm.put("usernamedescattr","usernamedesctest"); hm.put("DYN_KEY","VALUE"); hm.put("DYN_KEY1","VALUE1"); createAccount(hm); */ } catch (Exception ex) { ex.printStackTrace(); } } public static String changePassword(Map arg) { String message = ""; String description = ""; com.ibm.as400.access.AS400 as4 =null; try { String url = arg.get("connect_url"); String userName = arg.get("connect_username"); String password = arg.get("connect_password"); as4 = new com.ibm.as400.access.AS400(url,userName,password); as4.setGuiAvailable(false); System.out.println("connection successful"); //command to reset password boolean result = false; boolean result1 = false; boolean result2 = false; CommandCall commandCall=new CommandCall(as4); commandCall.setCommand("CHGUSRPRF USRPRF("+arg.get("username")+") PASSWORD("+arg.get("password")+")"); result= commandCall.run(); System.out.println("password reset result " + result); AS400Message[] messagelist = commandCall.getMessageList(); for (int i = 0; i < messagelist.length; ++i) { // Show each message. System.out.println(messagelist[i].getText()); } if(result){ //command to expire password CommandCall commandCall1=new CommandCall(as4); commandCall1.setCommand("CHGUSRPRF USRPRF("+arg.get("username")+") PWDEXP(*YES)"); result1= commandCall1.run(); System.out.println("password expire result " + result1); AS400Message[] messagelist1= commandCall.getMessageList(); for (int i = 0; i < messagelist1.length; ++i) { // Show each message. System.out.println(messagelist1[i].getText()); } }else{ message = "Failure"; description = "Password cannot reset"; } if(result1){ //command to enable the user CommandCall commandCall2=new CommandCall(as4); commandCall2.setCommand("CHGUSRPRF USRPRF("+arg.get("username")+") STATUS(*ENABLED)"); result2= commandCall2.run(); System.out.println("enable result " + result2); AS400Message[] messagelist2 = commandCall.getMessageList(); for (int i = 0; i < messagelist2.length; ++i) { // Show each message. System.out.println(messagelist2[i].getText()); } }else{ message = "Failure"; description = "User doesn't enable"; } message = "Success"; description = "Password changed successfully"; } catch(Exception ex) { ex.printStackTrace(); message = "Failure"; description = "Failed to change the password"; } finally { if(as4!=null && as4.isConnected()) as4.disconnectAllServices(); } JSONObject returnJsonObject = new JSONObject(); returnJsonObject.put("message", message); returnJsonObject.put("description", description); return returnJsonObject.toString(); } public static String createAccount(Map arg) { String message = ""; String description = ""; com.ibm.as400.access.AS400 as4 =null; try { String url = arg.get("connect_url"); String userName = arg.get("connect_username"); String password = arg.get("connect_password"); String taskType = arg.get("taskType"); String taskid = arg.get("taskid"); InputStream inputStream = null; AESCrypt aes = new AESCrypt(); String saviyntHome = System.getenv("SAVIYNT_HOME"); System.out.println(saviyntHome); String propFileName = saviyntHome + File.separator + "configurationAS400.properties"; System.out.println("configurationAS400.properties found at :" + propFileName); Properties prop = new Properties(); inputStream = new FileInputStream(propFileName); prop.load(inputStream); if(taskType!=null) { if(!taskType.equals("")) { if(taskType.equals("3")) { System.out.println("Processing Create Account Start"); TokenPojo token = new TokenPojo(); CommandBuilderCS cb = new CommandBuilderCS(); String commandString = cb.buildCreateAccountCommand(prop,arg); as4 = new com.ibm.as400.access.AS400(url,userName,password); as4.setGuiAvailable(false); System.out.println("connection successful"); boolean result = false; CommandCall commandCall=new CommandCall(as4); commandCall.setCommand(commandString); result= commandCall.run(); System.out.println("create account result " + result); AS400Message[] messagelist = commandCall.getMessageList(); for (int i = 0; i < messagelist.length; ++i) { // Show each message. System.out.println(messagelist[i].getText()); } if(result){ System.out.println("Create account success"); message = "Success"; description = "Create account success"; changeUser(arg, prop); }else{ System.out.println("Create account failure"); message = "Failure"; description = "Create account failure"; } System.out.println("Processing Create Account End"); } else { System.out.println("Processing Create Account(Add Access) Start"); System.out.println("Tasktype is not create account"); System.out.println("Processing Create Account(Add Access) End"); } } } } catch(Exception ex) { ex.printStackTrace(); message = "Failure"; description = "Failed to create account"; } finally { if(as4!=null && as4.isConnected()) as4.disconnectAllServices(); } JSONObject returnJsonObject = new JSONObject(); returnJsonObject.put("message", message); returnJsonObject.put("description", description); return returnJsonObject.toString(); } public static void changeUser(Map arg,Properties prop) { com.ibm.as400.access.AS400 as41 =null; try { System.out.println("Executing changeUser command.."); String url = arg.get("connect_url"); String userName = arg.get("connect_username"); String password = arg.get("connect_password"); String cmdStr = "CHGUSRAUD"+arg.get("groupprofile"); System.out.println("Group profile is : " + arg.get("groupprofile")); System.out.println("Get value from properties file "+prop.getProperty(cmdStr)); String cmdStr1 = prop.getProperty(cmdStr); String commandString="CHGUSRAUD USRPRF("+arg.get("username")+") "+cmdStr1; System.out.println("Command string : "+commandString); as41 = new com.ibm.as400.access.AS400(url,userName,password); as41.setGuiAvailable(false); System.out.println("connection successful"); CommandCall commandCall=new CommandCall(as41); commandCall.setCommand(commandString); boolean result= commandCall.run(); System.out.println("changeUser result " + result); AS400Message[] messagelist = commandCall.getMessageList(); for (int i = 0; i < messagelist.length; ++i) { // Show each message. System.out.println(messagelist[i].getText()); } } catch (Exception ex) { ex.printStackTrace(); } finally { if(as41!=null && as41.isConnected()) as41.disconnectAllServices(); } } /* public static String importAccountsFull(Map arg) { String message = ""; String description = ""; try { String url = arg.get("connect_url"); String userName = arg.get("connect_username"); String password = arg.get("connect_password"); InputStream inputStream = null; AESCrypt aes = new AESCrypt(); String saviyntHome = System.getenv("SAVIYNT_HOME"); System.out.println(saviyntHome); String propFileName = saviyntHome + File.separator + "configurationAS400.properties"; System.out.println("configurationAS400.properties found at :" + propFileName); Properties prop = new Properties(); inputStream = new FileInputStream(propFileName); prop.load(inputStream); String commandstring = prop.getProperty("IMPORTACCOUNTSCOMMANDSTRING"); System.out.println("Processing Account Import Full Start"); com.ibm.as400.access.AS400 as4 = new com.ibm.as400.access.AS400(url,userName,password); as4.setGuiAvailable(false); System.out.println("connection successful"); boolean result = false; CommandCall commandCall=new CommandCall(as4); commandCall.setCommand(commandstring); result= commandCall.run(); System.out.println("Import accounts result " + result); if(result){ System.out.println("Import accounts success"); message = "Success"; description = "Import accounts success"; }else{ System.out.println("Import accounts failure"); message = "Failure"; description = "Import accounts failure"; } System.out.println("Import accounts Account End"); } catch(Exception ex) { ex.printStackTrace(); message = "Failure"; description = "Failed to create account"; } JSONObject returnJsonObject = new JSONObject(); returnJsonObject.put("message", message); returnJsonObject.put("description", description); return returnJsonObject.toString(); } */ public static String decode(String strToDecrypt) { byte[] key = "S@v!ynt_s@V!YNt_".getBytes(); if(strToDecrypt !=null ) { try { Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING"); final SecretKeySpec secretKey = new SecretKeySpec(key, "AES"); cipher.init(Cipher.DECRYPT_MODE, secretKey); final String decryptedString = new String(cipher.doFinal(Base64.decodeBase64(strToDecrypt))); return decryptedString; } catch (Exception e) { e.printStackTrace(); } } return null; } public static String importAccountsFull(Map arg) { //public static String importAccountsFull() { String message = ""; String description = ""; List data =null; boolean result=true; try { String url = arg.get("connect_url"); String userName = arg.get("connect_username"); String password = arg.get("connect_password"); InputStream inputStream = null; AESCrypt aes = new AESCrypt(); String saviyntHome = System.getenv("SAVIYNT_HOME"); System.out.println(saviyntHome); String propFileName = saviyntHome + File.separator + "configurationAS400.properties"; System.out.println("configurationAS400.properties found at :" + propFileName); Properties prop = new Properties(); inputStream = new FileInputStream(propFileName); prop.load(inputStream); String AS400AccountsName = saviyntHome + File.separator + "AS400AccountsMapping.properties"; System.out.println("AS400AccountsMapping.properties found at :" + propFileName); Properties propAccMapping = new Properties(); inputStream = new FileInputStream(AS400AccountsName); propAccMapping.load(inputStream); System.out.println("Processing Account Import Full Start"); System.out.println("Connecting via FTP to retrieve file from server : "+url); FTP client = new FTP(url,userName,password); client.cd(prop.getProperty("ISERIESIMPORTDIRECTORY")); client.setDataTransferType(FTP.ASCII); System.out.println("Current directory " + client.getCurrentDirectory()); String [] entries = client.ls(); for (int i = 0; i < entries.length; i++) { System.out.println("File/s found " + entries[i]); } boolean transferSuccess = client.get(prop.getProperty("ISERIESFILENAME"), prop.getProperty("ISERIESTEMPPATH")); System.out.println("Response is : " + transferSuccess); if(transferSuccess) { System.out.println("File transferred successfully : " + prop.getProperty("ISERIESTEMPPATH")); CSVReaderImplementor cri = new CSVReaderImplementor(prop.getProperty("ISERIESTEMPPATH")); List accountList = cri.getEntries(); /* System.out.println("Records found : "); for(int i = 0; i < 10; i++) { System.out.println(cri.getEntries().get(i).toString()); }*/ /*message = "Success"; data = accountList; */ //CSVReaderImplementor cri = new CSVReaderImplementor("/Users/aditi.pandya/Documents/USRSAVIYND.csv"); //List accountList = cri.getEntries(); //String jsonExp="{\"accounts.name\": \"UserProfile\",\"accounts.description\": \"Textdescription\",\"endpoints.endpointname\": \"endpoint\",\"securitysystems.systemname\": \"secsystem\"}"; String jsonExp=arg.get("accountMapping"); JSONParser parser = new JSONParser(); org.json.simple.JSONObject json = (org.json.simple.JSONObject) parser.parse(jsonExp); Set keys = json.keySet(); List listOfResultsMap = new LinkedList(); List newAccountList= new LinkedList(); List existingAccountList = new LinkedList (); System.out.println("Records found : "); for(int i = 0; i < accountList.size(); i++) { Map resultsMap = new HashMap(); String[] strArr = (String[]) cri.getEntries().get(i); Iterator iterator = keys.iterator(); while(iterator.hasNext()) { String keyElement = iterator.next(); String property = (String)json.get(keyElement); //System.out.println("Property name :"+property); /*if(property.equals("UserProfile")) { resultsMap.put(property,strArr[4]); } else if(property.equals("Textdescription")) { resultsMap.put(property,strArr[35]); }*/ if(property.equals("endpoint")) { //resultsMap.put(property,"Radar"); resultsMap.put(property,arg.get("endpoint")); } else if(property.equals("secsystem")) { //resultsMap.put(property,"Radar"); resultsMap.put(property,arg.get("secsystem")); } else if(property.equals("status")) { //resultsMap.put(property,"Radar"); //resultsMap.put(property,arg.get("status")); int index = Integer.parseInt(propAccMapping.getProperty(property)); System.out.println("Status for the user :"+strArr[index]); if(strArr[index].contains("*ENABLED")) { //resultsMap.put(property,"Active"); resultsMap.put(property,"1"); System.out.println("Setting status as active for user"); } else if(strArr[index].contains("*DISABLED") || strArr[index].equalsIgnoreCase("0")) { System.out.println("Setting status as Suspended for user"); //resultsMap.put(property,"Suspended"); //resultsMap.put(property,"In-Active"); resultsMap.put(property,"2"); } else { System.out.println("Setting status as "+strArr[index]+" for user"); resultsMap.put(property, strArr[index]); } } else if(property.equals("User Profile Name")) { int index = Integer.parseInt(propAccMapping.getProperty(property)); System.out.println("Processing account name.."+strArr[index]); resultsMap.put(property, strArr[index]); newAccountList.add(strArr[index]); } else { int index = Integer.parseInt(propAccMapping.getProperty(property)); resultsMap.put(property, strArr[index]); } } listOfResultsMap.add(resultsMap); //System.out.println(cri.getEntries().get(i).toString()); } System.out.println("List of accounts processed size : "+newAccountList.size()); String newAccountString = String.join(",", newAccountList); System.out.println("List of accounts processed : "+newAccountString); DataBaseConnection dc = null; DataBaseDemo dm = new DataBaseDemo(); dc = dm.getDatabaseConnection(prop.getProperty("db_url"),prop.getProperty("user"),decode(prop.getProperty("pass")),prop.getProperty("JDBC_DRIVER")); String existingAccounts="select a.name as name,a.accountkey as accountkey from accounts a,endpoints e where a.endpointkey=e.endpointkey and e.endpointname='"+arg.get("endpoint")+"'"; Statement stat = dc.conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet rs = stat.executeQuery(existingAccounts); rs.last(); int size = rs.getRow(); System.out.println("Number of existing users : "+size); rs.beforeFirst(); while (rs.next()) { try { String name = rs.getString("name"); if(!newAccountList.contains(name.toUpperCase())) { System.out.println("Deleting account : "+name); String accountkey = rs.getString("accountkey"); //String accountSuspensionQry = "UPDATE ACCOUNTS SET STATUS='SUSPENDED FROM IMPORT SERVICE' where STATUS <> 'SUSPENDED FROM IMPORT SERVICE' and accountkey='"+accountkey+"'"; String timeStamp = new SimpleDateFormat("MM-dd-yyyy_HH:mm").format(Calendar.getInstance().getTime()); String accountSuspensionQry = "UPDATE ACCOUNTS SET STATUS='SUSPENDED FROM IMPORT SERVICE',NAME=CONCAT(NAME,'-Deleted on-','"+timeStamp+"') where STATUS <> 'SUSPENDED FROM IMPORT SERVICE' and accountkey='"+accountkey+"'"; System.out.println("Suspending accounts using the Qry -"+accountSuspensionQry); Statement stat1 = dc.conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); stat1.executeUpdate(accountSuspensionQry); } } catch(Exception e) { e.printStackTrace(); } } message = "Success"; data = listOfResultsMap; } else { System.out.println("File transfer unsuccessful : " + prop.getProperty("ISERIESTEMPPATH")); } client.disconnect(); if(result){ System.out.println("Import accounts success"); message = "Success"; description = "Import accounts success"; }else{ System.out.println("Import accounts failure"); message = "Failure"; description = "Import accounts failure"; } System.out.println("Import accounts Account End"); } catch(Exception ex) { ex.printStackTrace(); message = "Failure"; description = "Failed to create account"; } JSONObject returnJsonObject = new JSONObject(); returnJsonObject.put("message", message); returnJsonObject.put("description", description); returnJsonObject.put("data", data); return returnJsonObject.toString(); } public static String removeAccess(Map arg) { String message = ""; String description = ""; com.ibm.as400.access.AS400 as4 = null; try { String url = arg.get("connect_url"); String userName = arg.get("connect_username"); String password = arg.get("connect_password"); String accountName = arg.get("accountName"); String employeeid = arg.get("employeeid"); String statuskey = arg.get("statuskey"); System.out.println("Employee id : "+employeeid); System.out.println("Statuskey : "+statuskey); if(statuskey!= null && employeeid!=null) { if(statuskey.equals("0") && employeeid.equalsIgnoreCase("Yes")) { System.out.println("Executing remove account.. "); InputStream inputStream = null; AESCrypt aes = new AESCrypt(); String saviyntHome = System.getenv("SAVIYNT_HOME"); System.out.println(saviyntHome); String propFileName = saviyntHome + File.separator + "configurationAS400.properties"; System.out.println("configurationAS400.properties found at :" + propFileName); Properties prop = new Properties(); inputStream = new FileInputStream(propFileName); prop.load(inputStream); String commandstring = prop.getProperty("REMOVEACCOUNTCOMMANDSTRING"); System.out.println("Processing Remove Access Start"); CommandBuilder cb = new CommandBuilder(); //String commandString = "CALL PGM(TESTCU/SAVIYNTDLT) PARM("+accountName+")"; String commandString = commandstring+"("+accountName+")"; as4 = new com.ibm.as400.access.AS400(url,userName,password); as4.setGuiAvailable(false); System.out.println("connection successful"); boolean result = false; CommandCall commandCall=new CommandCall(as4); commandCall.setCommand(commandString); result= commandCall.run(); System.out.println("remove access result " + result); AS400Message[] messagelist = commandCall.getMessageList(); for (int i = 0; i < messagelist.length; ++i) { // Show each message. System.out.println(messagelist[i].getText()); } if(result){ System.out.println("remove access success"); message = "Success"; description = "access removed successfully"; }else{ System.out.println("remove access failure"); message = "Failure"; description = "remove access failure"; } System.out.println("Processing remove access End"); } else { //System.out.println("Executing disable account.. "); String commandstring = "CHGUSRPRF USRPRF("+accountName+") STATUS(*DISABLED)"; System.out.println("Processing Disable Account Start"); CommandBuilder cb = new CommandBuilder(); //String commandString = "CALL PGM(TESTCU/SAVIYNTDLT) PARM("+accountName+")"; String commandString = commandstring; as4 = new com.ibm.as400.access.AS400(url,userName,password); as4.setGuiAvailable(false); System.out.println("connection successful"); boolean result = false; CommandCall commandCall=new CommandCall(as4); commandCall.setCommand(commandString); result= commandCall.run(); System.out.println("Disable Account result " + result); AS400Message[] messagelist = commandCall.getMessageList(); for (int i = 0; i < messagelist.length; ++i) { // Show each message. System.out.println(messagelist[i].getText()); } if(result){ System.out.println("Disable Account success"); message = "Success"; description = "Disable Account successfully"; }else{ System.out.println("Disable Account failure"); message = "Failure"; description = "Disable Account failure"; } System.out.println("Processing remove access End"); } } } catch(Exception ex) { ex.printStackTrace(); message = "Failure"; description = "Failed to disable/remove account"; } finally { if(as4!=null && as4.isConnected()) as4.disconnectAllServices(); } JSONObject returnJsonObject = new JSONObject(); returnJsonObject.put("message", message); returnJsonObject.put("description", description); return returnJsonObject.toString(); } public static String enableAccount(Map arg) { String message = ""; String description = ""; com.ibm.as400.access.AS400 as4 = null; try { String url = arg.get("connect_url"); String userName = arg.get("connect_username"); String password = arg.get("connect_password"); String accountName = arg.get("accountName"); InputStream inputStream = null; AESCrypt aes = new AESCrypt(); String saviyntHome = System.getenv("SAVIYNT_HOME"); System.out.println(saviyntHome); String propFileName = saviyntHome + File.separator + "configurationAS400.properties"; System.out.println("configurationAS400.properties found at :" + propFileName); Properties prop = new Properties(); inputStream = new FileInputStream(propFileName); prop.load(inputStream); String commandstring = "CHGUSRPRF USRPRF("+accountName+") STATUS(*ENABLED)"; System.out.println("Processing Enable Account Start"); CommandBuilder cb = new CommandBuilder(); //String commandString = "CALL PGM(TESTCU/SAVIYNTDLT) PARM("+accountName+")"; String commandString = commandstring; as4 = new com.ibm.as400.access.AS400(url,userName,password); as4.setGuiAvailable(false); System.out.println("connection successful"); boolean result = false; CommandCall commandCall=new CommandCall(as4); commandCall.setCommand(commandString); result= commandCall.run(); System.out.println("Enable Account result " + result); AS400Message[] messagelist = commandCall.getMessageList(); for (int i = 0; i < messagelist.length; ++i) { // Show each message. System.out.println(messagelist[i].getText()); } if(result){ System.out.println("Enable Account success"); message = "Success"; description = "Enable Account successfully"; }else{ System.out.println("Enable Account failure"); message = "Failure"; description = "Enable Account failure"; } System.out.println("Processing Enable Account End"); } catch(Exception ex) { ex.printStackTrace(); message = "Failure"; description = "Failed to Enable Account"; } finally { if(as4!=null && as4.isConnected()) as4.disconnectAllServices(); } JSONObject returnJsonObject = new JSONObject(); returnJsonObject.put("message", message); returnJsonObject.put("description", description); return returnJsonObject.toString(); } public static String disableAccount(Map arg) { String message = ""; String description = ""; com.ibm.as400.access.AS400 as4 = null; try { String url = arg.get("connect_url"); String userName = arg.get("connect_username"); String password = arg.get("connect_password"); String accountName = arg.get("accountName"); InputStream inputStream = null; AESCrypt aes = new AESCrypt(); String saviyntHome = System.getenv("SAVIYNT_HOME"); System.out.println(saviyntHome); String propFileName = saviyntHome + File.separator + "configurationAS400.properties"; System.out.println("configurationAS400.properties found at :" + propFileName); Properties prop = new Properties(); inputStream = new FileInputStream(propFileName); prop.load(inputStream); String commandstring = "CHGUSRPRF USRPRF("+accountName+") STATUS(*DISABLED)"; System.out.println("Processing Disable Account Start"); CommandBuilder cb = new CommandBuilder(); //String commandString = "CALL PGM(TESTCU/SAVIYNTDLT) PARM("+accountName+")"; String commandString = commandstring; as4 = new com.ibm.as400.access.AS400(url,userName,password); as4.setGuiAvailable(false); System.out.println("connection successful"); boolean result = false; CommandCall commandCall=new CommandCall(as4); commandCall.setCommand(commandString); result= commandCall.run(); System.out.println("Disable Account result " + result); AS400Message[] messagelist = commandCall.getMessageList(); for (int i = 0; i < messagelist.length; ++i) { // Show each message. System.out.println(messagelist[i].getText()); } if(result){ System.out.println("Disable Account success"); message = "Success"; description = "Disable Account successfully"; }else{ System.out.println("Disable Account failure"); message = "Failure"; description = "Disable Account failure"; } System.out.println("Processing remove access End"); } catch(Exception ex) { ex.printStackTrace(); message = "Failure"; description = "Failed to Disable Account"; } finally { if(as4!=null && as4.isConnected()) as4.disconnectAllServices(); } JSONObject returnJsonObject = new JSONObject(); returnJsonObject.put("message", message); returnJsonObject.put("description", description); return returnJsonObject.toString(); } public static String getAuthID() { String str = "test1,test2,test3"; return str; } }