Two Laptop Bag*
The moose likes JForum and the fly likes SSO and email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "SSO and email" Watch "SSO and email" New topic

SSO and email

Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I'm some what confused by the docs/SSO example class..
The docs show that defines: - the name of the session parameter used for updateing jforum email adress

so I have this set to email:

then based on the example SSO code shows :

now..logicaly upgrading this code to 2.1.8 we would get:

so I verified the email attribute is indeed being set..but I have the user profile doesnt reflect the email address? also If I dump the session.attributes in isSessionValid() via:
SessionContext sc = ctx.getSessionContext();
Enumeration e = sc.getAttributeNames();
it does not show the email entry..making me thing ctx.setAttribute() from RequestContext has nothing do with the actual http session?

what am I missing? any pointers on how to get jforum to use the email address?

[originally posted on by dano]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Ok, I got it.. using 2.1.8 here is what I came up with:

public String authenticateUser(RequestContext ctx)
{ ...(get what u need from the cookie/database)
ctx.getSessionContext().setAttribute("email", email);
ControllerUtils.addCookie("JforumSSO", username, UtilToken.TOKEN_TIME);

It should be noted: if the user Already exists, the email address will NOT be persisted.

BTW: is there any easy way to disable/remove the 'Registration Informaration' section from the My Profile page when using SSO?

[originally posted on by dano]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
oh..I hacked ControllerUtil to match the other examples..allowing the creation of session cookie, rather the the persistent cookie it uses (that is good for about a year...).
[originally posted on by dano]
I agree. Here's the link:
subject: SSO and email
Similar Threads
sso(my app) 1stuser login and logout 2nd user login it show Connected users:1st login userinfo
Using JForum SSO - a kludger's tale
Cookie-based SSO and v2.1.7
about SSO