PrintWriter out = response.getWriter();
out.println("<h3>Login to My Proxy server using your credentials!</h3><br>");
out.close();
throw new Exception("Login to My Proxy server using your credentials!");
}
GSSCredential gssCredential = ProxyManager.getDefaultProxy(username);
context.setGssCredential(gssCredential);
if(context.getXmcCatTestUser() == null ){
context.setXmcCatTestUser(gssCredential.getName().toString());
}
context.setPortalUserName(username);
System.out.println("Getting Grid credential form Proxy worked for " + username);
// to create RegistryService instance
ValueBinding binding = application.createValueBinding("#{applicationGlobalContext}");
binding.setValue(facesContext, context);
this.setContext(context);
checkStatus = true;
}else{
UserInfo userInfo = (UserInfo) facesContext.getExternalContext().getSessionMap().get("userInfo");
String userName = userInfo.getUserName();
GSSCredential credential = ProxyManager.getDefaultProxy(userName);
if(credential != null){
context = new ApplicationGlobalContext();
context.setGssCredential(credential);
context.load();
facesContext.getExternalContext().getSessionMap().put("applicationGlobalContext", context);