cancel
Showing results for 
Search instead for 
Did you mean: 

Testing Alfresco Share to use an external SSO

shibu
Champ in-the-making
Champ in-the-making
I have done the example mentioned here :– http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Fauth-alfrescoe... –  for connecting Alfresco Share to use an external SSO. No changes made in the given example. My alfresco is running in 8080 port.
The userHeader is given as <userHeader>ExternalSsoSystemHeader</userHeader> itself.

Now I just want to test it with a simple dynamic web applicatoin in eclipse.
I just want to open Alfresco user Dash board page by clicking a button with out showing log in page from a page created in the simple dynamic web application. Can any one write the code here please…
2 REPLIES 2

shibu
Champ in-the-making
Champ in-the-making
I tried with following JSP code;

<%

URL url1 = new URL("http://localhost:8080/share/page");
HttpURLConnection conn = (HttpURLConnection) url1.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestProperty("SsoUserHeader", "admin");

for (int i = 0;; i++) {
   String headerName = conn.getHeaderFieldKey(i); 
   String headerValue = conn.getHeaderField(i);  
   System.out.println(headerName + "==="); 
   System.out.println(headerValue); 
   if (headerName == null && headerValue == null) {     break;   }
}
String sessionValue = conn.getHeaderField("Set-Cookie").substring(0,conn.getHeaderField("Set-Cookie").indexOf(";"));
conn.setRequestProperty("Set-Cookie", sessionValue);
conn.connect();
BufferedReader dis = new BufferedReader(
                         new InputStreamReader(
                             conn.getInputStream()));
String myString;
while ((myString = dis.readLine()) != null)
{
   
    System.out.println(myString);
}

conn.setInstanceFollowRedirects(false);

int responseCode = conn.getResponseCode();
System.out.println( responseCode );
String location = conn.getHeaderField( "Location" );
System.out.println( location );
String urlstring = conn.getHeaderField("Location");
response.sendRedirect(urlstring);

%>


In Console I am getting out put as;


null===
HTTP/1.1 302 Found
Server===
Apache-Coyote/1.1
Set-Cookie===
JSESSIONID=7BBDB706EB1006133932EBC11074DB18; Path=/share/; HttpOnly
Cache-Control===
no-cache
Location===
http://localhost:8080/share/page/user/admin/dashboard
Content-Type===
text/html;charset=utf-8
Content-Language===
en-US
Content-Length===
0
Date===
Thu, 18 Apr 2013 07:01:52 GMT
null===
null
302
http://localhost:8080/share/page/user/admin/dashboard



And Page is redirected to http://localhost:8080/share/page/user/admin/dashboard. But it is asking for Username and Password.

Please help me to do SSO here.

afaust
Legendary Innovator
Legendary Innovator
Hello,

as this appears to be almost the same issue as in <a href="https://forums.alfresco.com/forum/installation-upgrades-configuration-integration/authentication-lda...">this thread</a>, please see my comment there.

Regards
Axel