我在我的应用程序中使用MFP8。我正在使用安全检查框架来验证用户。为了验证用户,我正在使用一些后端图层来验证用户。一旦用户验证我的后端服务将返回巨大的JSON。现在我需要将此响应发送给客户端。安全检查后IBM MFP8 Respnse
PFB我在UserLogin适配器中试过的代码。来自后端层的响应是JSON格式非常巨大的响应(75-80KB)。请帮助如何将这种响应从安检发送到客户端
P.S:
public class UserLoginResource extends UserAuthenticationSecurityCheck {
private String userId, displayName,errorMsg, cdata, hdata, rid, urlParams, serviceName, queryParameters;
private boolean rememberMe = false;
private boolean authFlag=true;
public static JSONObject queryResponse;
private Map<String, Object> attributes = new HashMap<String, Object>();
@Context
AdapterSecurityContext adapterSecurityContext;
@Override
protected AuthenticatedUser createUser() {
System.out.println("User Authenticated Result "+ userId);
return new AuthenticatedUser(userId, displayName, this.getName(), attributes);
}
@Override
protected boolean validateCredentials(Map<String, Object> credentials) {
try{
String username=credentials.get("username").toString();
String password = credentials.get("password").toString(); ;
if (username != null && password != null) {
queryResponse = <my backend layer>(username, password);
if(queryResponse.errorExist){
System.out.println("User Authentication Failed");
errorMsg="User Authentication Failed";
return false;
}
else{
System.out.println("User Authentication Sucessful");
userId=queryResponse.userid;
displayName=queryResponse.fullname;
attributes.put("queryParams", queryResponse.toString());
authFlag=false;
errorMsg = null;
return true;
}
}
}
catch(Exception e){
e.printStackTrace();
authFlag =true;
return false;
}
return false;
}
}