-
1. Re: Setting a
fernando_jmt Feb 20, 2007 6:00 PM (in response to mikedougherty)Currently Seam Identity class does not have a "Name" property. It coud be nice if Seam guys add this property in the future. I think sometimes we need to display the user who is logged in, currently I can only show the username, but it would be better display the full name.
At this time the only way you can do this is extending the Identity class (adding the name property) in your application, and configure that identity class instead of default Seam one.
HTH. -
2. Re: Setting a
pmuir Feb 20, 2007 6:08 PM (in response to mikedougherty)The message can be overridden in your resource bundle with the property key org.jboss.seam.loginSuccessful.
-
3. Re: Setting a
shane.bryzak Feb 20, 2007 6:10 PM (in response to mikedougherty)Just override the login message. I've even updated the seamspace example to show how to do this.
-
4. Re: Setting a
fernando_jmt Feb 20, 2007 6:18 PM (in response to mikedougherty)Well, I think overwriting the login message will work only to display the message immediately the user has logged in.
But by instance I wanna display the user full name in the top of the page all the time the user is working in its session. ¿What to do in this case? -
5. Re: Setting a
fernando_jmt Feb 20, 2007 6:20 PM (in response to mikedougherty)Well, I think overwriting the login message will work only to display the message immediately the user has logged in.
But by instance I wanna display the user full name in the top of the page all the time the user is working in its session. ¿What to do in this case? -
6. Re: Setting a
fernando_jmt Feb 20, 2007 6:28 PM (in response to mikedougherty)I know, I can add the full name in a separately session variable, but this will not part of the identity as well.
-
7. Re: Setting a
shane.bryzak Feb 20, 2007 6:51 PM (in response to mikedougherty)Identity is the wrong place for this, it is purely concerned with authentication and only contains principals it needs to authenticate. Using a session-scoped component is perfectly valid for displaying the user's full name.
-
8. Re: Setting a
mikedougherty Feb 21, 2007 11:48 PM (in response to mikedougherty)"shane.bryzak@jboss.com" wrote:
Identity is the wrong place for this, it is purely concerned with authentication and only contains principals it needs to authenticate. Using a session-scoped component is perfectly valid for displaying the user's full name.
The authenticator is what is concerned about authentication, and I would agree that the authenticator should only have authentication code in it. At least this is the direction Seam appears to be taking. (Note: that I said "appears" because I have not read the road map and am not 100% sure about that).
But isn't the Identity object used to identify the user who has been authenticated? If this is true, then the attributes that "identify" a user could differ greatly based on the application. In normal cases the default Identity object might suffice. But it would be nice to be able to define a custom (subclass) Identity object where I can add attributes based on what my application needs.
Anyway, I'm still just getting my feet wet with Seam, so take my thoughts as just that thoughts (and if you feel like it, suggestions).
Thanks for the info. -
9. Re: Setting a
christian.bauer Feb 22, 2007 2:04 AM (in response to mikedougherty)Everbody has different requirements what "currently logged in user" means in their application. The Seam identity component handles two very well defined concerns: principal and subjects.
If you want a "displayName", and I want a "my.User" available after login, we should outject it into the SESSION scope from your authenticate() method in the authenticator. That is clean and nothing could be easier than an additional line of code in a method. -
10. Re: Setting a
mikedougherty Feb 22, 2007 10:23 AM (in response to mikedougherty)I'm sort of new here and still getting a feel for the community, and really do not know how open this community is to debate (especially from new-comers). So I'll make one last comment and let it go at that.
I'm not saying outjecting a User session object is hard, or wrong. It is what I am doing, albeit the hard way. From what I've seen so far Seam provides user configurability in just about every area, with this one exception.
Also, you are right about the Principal and Subjects. However, the Identity object does allow me to set a Principal. I can add one to the list in Subjects. But then finding the right one in the JSF might be a bit more trouble than it's worth.
Anyway, thanks again for the info, and the correction to my code. -
11. Re: Setting a
pmuir Feb 22, 2007 10:48 AM (in response to mikedougherty)So I think the thing is here that unless Seam actually started providing a basic User class (which would be a bad thing as this is domain model specific) there is no sensible way to store any information about the user on Identity. FWIW I just extend Identity and add get/setUser methods to it (where User is an entity I've defined).
@Name("org.jboss.seam.security.identity") public class Identity extends org.jboss.seam.security.Identity {
-
12. Re: Setting a
mikedougherty Feb 22, 2007 4:29 PM (in response to mikedougherty)"petemuir" wrote:
So I think the thing is here that unless Seam actually started providing a basic User class (which would be a bad thing as this is domain model specific) there is no sensible way to store any information about the user on Identity. FWIW I just extend Identity and add get/setUser methods to it (where User is an entity I've defined).@Name("org.jboss.seam.security.identity") public class Identity extends org.jboss.seam.security.Identity {
Thanks petemuir, that's exactly the kind of info, and solution I was looking for. Did I miss that in the docs somewhere?
Thanks!