aspose file tools*
The moose likes JForum and the fly likes about net.jforum.sso.CookieUserSSO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "about net.jforum.sso.CookieUserSSO" Watch "about net.jforum.sso.CookieUserSSO" New topic
Author

about net.jforum.sso.CookieUserSSO

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
hi, guys

when I read the document about how to integrate JForum SSO, from this document ,it refere to a
net.jforum.sso.CookieUserSSO as default sso. Actually, I cann't find this class from source which i download in src.2.1.8? :x

thanks.
[originally posted on jforum.net by tidysea]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
CookieUserSSO is just as an example, but it isnt integrated I think. There's a simple SSO file however in that folder (starting with 'R' i think) that shows the basic functionality. It only checks if the "user" object is filled in the request I think.

Dont have the code in front of me right now though, so pardon my guesses.

It's really easy though to write your own implementation.

And though cookie based auth is suggested, I think that URL authentication is almost a bit better, along with timestamp and cipher. It allows to pass a various amount of parameters, secured.

Feel free to search the forum too for SSO. It should return plenty of posts, some with examples on implementation, some with hints and thus.
[originally posted on jforum.net by Sid]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
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]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
CookieUserSSO does not exist in the latest source. If it isn't there, it would be nice if the documentation said something like "This is just an example implementation. CookieUserSSO doesn't exist in the source or packaged .war file"
[originally posted on jforum.net by dwwood]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Aggreed. Documentation updated: http://www.jforum.net/doc/SSOCookies

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Thanks!
[originally posted on jforum.net by dwwood]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about net.jforum.sso.CookieUserSSO
 
Similar Threads
Help about SSO
Running 1.5 from CVS?
net.jforum.sso.CookieUserSSO is missing in release 2.1.8
SSO question
SSO with JForum