Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

SSO and New User

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In my custom cookie sso class. In the authenticateuser method i am setting the email to like this.

SessionContext session = JForumExecutionContext.getRequest().getSessionContext();
session.setAttribute("sso.email.attribute", user.getEmail());

I added a println in the checkSSO method of controllerutils like this:

String email = (String) session.getAttribute(SystemGlobals.getValue(ConfigKeys.SSO_EMAIL_ATTRIBUTE));
System.out.println("email from session "+email);

The email attribute is null at this point so the new user is setup with the default email address from SystemGlobals.

Has anyone else come across a problem like this

Thanks

Paul
[originally posted on jforum.net by jonesp123]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have trawled this forum trying to find the answer but haven't had any luck.

I have implemented a cookiesso mechanism. This works fine.

Is this possible. When jforum creates a jforum user on the fly how can i set the email address it uses to be the email address for the user in the main app.

Do i have to update the users table manually? If so at what point do i know a user has been created on the fly?

Can i set something in authenticateUser that will set the email address on the jforum user.

The reason i need to set the email address is obviously for reply notifications etc..

Thanks and sorry for another post.

Paul
[originally posted on jforum.net by jonesp123]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Might be me being stupid. Wouldn't be the first time but shouldn't the line in ControllerUtils

protected void checkSSO(UserSession userSession)

the line is

String email = (String) session.getAttribute(SystemGlobals.getValue(ConfigKeys.SSO_EMAIL_ATTRIBUTE));

should this be
// gets the email address stored in the session
String email = (String) session.getAttribute(ConfigKeys.SSO_EMAIL_ATTRIBUTE);

or
// get the email address stored in the config
String email = (String) SystemGlobals.getValue(ConfigKeys.SSO_EMAIL_ATTRIBUTE);

The one in the source would be using an email address in the config as the name to look up in the session???.

Could someone help.

Thanks



[originally posted on jforum.net by jonesp123]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apologies everyone

just noticed this in the SystemGlobals file.

# The attribute name to search in the session for the password

oops
[originally posted on jforum.net by jonesp123]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The email address should be read from the cookie written by your webapp.


And you have to add the following line to ConfigKeys.java:


And also, add a new key to jforum-custom.conf


See also:
JForum SSO with User's first name and last name saved
[originally posted on jforum.net by andowson]
 
reply
    Bookmark Topic Watch Topic
  • New Topic