cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Inegration with JAVA/j2ee

manjunathab
Champ in-the-making
Champ in-the-making

var self = this;
var ticket;
var xmlHttpReq = false;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
var data = "{username:admin,password:admin}";
self.xmlHttpReq.open("POST", "http://blrkec335927d:8080/alfresco/service/api/login", true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'json');
self.xmlHttpReq.setRequestHeader('X-Alfresco-Remote-User', 'admin');
xmlHttpReq.onreadystatechange = function() {//Call a function when the state changes.
alert(xmlHttpReq.status);
if (xmlHttpReq.readyState == 4 && xmlHttpReq.status == 200)
{
var getTicket = JSON.parse(xmlHttpReq.responseText);
ticket = (getTicket.data).ticket;
var url1 = "http://blrkec335927d:8080/alfresco/service/ui/myspaces?f=0&p=%2FCompany%20Home&alf_ticket="+ticket;
var aa='';
document.getElementById('uploaddoc').innerHTML = aa;
}
}
self.xmlHttpReq.send(data);

${label['ALFRESCO_DOCUMENT']}

Above code is used for integration. But while loading iframe again its asking for username and password. Please any one help me.

2 REPLIES 2

mrogers
Star Contributor
Star Contributor
I note that it looks like you may be trying to use external authentication.   

But you have poorly worded your question.   Where does Java or J2EE come in ?   Are you trying to use external authentication ?   What is your relevant configuration ?

manjunathab
Champ in-the-making
Champ in-the-making
trying to call the login web content service from java script and using iframe trying to load it in JSP file.