thanks to sid.
I use cokieSSo like this, but it appear no use.
first:
I write a testsso.jsp like this:
<%
<br /> Cookie[] cookie1 = request.getCookies();
String acegiUserName = "hecong";
if(cookie1==null)
{
Cookie cookie = new Cookie("bbsUser", acegiUserName);
cookie.setMaxAge(-1); //???cookie???,???Cookie?
cookie.setPath("/");
response.addCookie(cookie);
}
else
{
for(int i=0; i< cookie1.length; i++)
{
String name = cookie1[i].getName();
String value = cookie1[i].getValue();
if(!name.equals("bbsUser"))
{
Cookie cookie = new Cookie("bbsUser", acegiUserName);
cookie.setMaxAge(-1);
cookie.setPath("/");
response.addCookie(cookie);
}
}
}
%>
I write a BISSO like this:
public class BISSO implements SSO{
public String authenticateUser(RequestContext request)
{
String username = null;
Cookie[] cookie = request.getCookies();
if(cookie == null)
{
//username = "guest";
}
else
{
for(int i=0; i< cookie.length; i++)
{
String name = cookie[i].getName();
String value = cookie[i].getValue();
if(name.equals("bbsUser"))
{
username = value;
break; }
}
}
System.out.println("coming to bisso"+username);
return username;
}
public boolean isSessionValid(UserSession userSession,RequestContext request)
{
System.out.println("coming to bisso session");
return false;
}
}
I update a config file
SystemGlobals.properties
sso.default.password = hecong
sso.implementation = net.jforum.sso.BISSO
authentication.type = sso
then i put the testsson.jsp to the server with jforum, and call it from explorer, but it appears nothing.
from my views, it will go to jforum directly.
is this my three steps has some wrong or other, if anyone who have implement your cokie sso,tell me please ,thanks a lot.
tidysea
[originally posted on jforum.net by tidysea]