Hi Matthias, I have finally managed to do what I wanted to do, maybe not in the best way though.
You didn't have to explicitly worry about the IdentifiableUsersManager interface because your custom manager implements RoleUsersManager, which extends IdentifiableUsersManager. Still, you certainly had to implement getLogin() and getAttributes(). I only implement IdentifiableUsersManager because I don't need the role feature. However, I have written a custom class that extends RoleUsersAttributes so that the getAttributes() method on the RoleUserIdentity returns my custom object in which I can store more information than just login, password, and role. I read the user's guide section on managing user data ( http://rifers.org/wiki/display/RIFE/GuideDatabaseUsers#GuideDatabaseUsers-sect1additionaldata ) but wasn't sure how to link that to my custom credentials manager. Also, about your IDENTIFIED element, I don't think it is used at all unless you have other elements that inherits from it, so I wasn't sure either about how to use it. Anyway, my application works at the moment so I will keep going even though I doubt I am really managing my user data the best way. Also, some details of rife are still obscure to me. I am not sure how the identity information is saved. I think it is sent to the client and I don't know how to explicitly keep it on the server side (which, in my understanding, would require defining a db table). All that is a bit of thinking aloud but maybe it can help somebody who'll read it. In the meantime, I'll keep tinkering with rife until I understand it more. At any rate, thanks for your help. Rodrigue On Jun 19, 11:09 am, Matthias Barmeier <[EMAIL PROTECTED]> wrote: > Hi Rodrigue, > > my Factory is really simple: > > package de.sourcepark.ms2.rife; > > import com.uwyn.rife.authentication.CredentialsManager; > import > com.uwyn.rife.authentication.credentialsmanagers.CredentialsManagerFactory; > import com.uwyn.rife.ioc.HierarchicalProperties; > import com.uwyn.rife.ioc.exceptions.PropertyValueException; > > No Id on have a Manager that implementes the interface you mentioned my > decalaration is: > > public class MS2CredentialsManager implements CredentialsManager, > RoleUsersManager > > What I have copied from some examples and not really understand is this > main.xml element: > > <element id="IDENTIFIED" > extends="rife/authenticated/identified.xml"> > <property name="authElementId">AuthClient</property> > <childtrigger name="authid"/> > </element> > > May be this creates the things you need on the fly. > > Ciao > Matthias > > Rodrigue wrote: > > Hi Matthias, > > > thank you again for your reply. I still have some trouble though. > > > When I call > > > RoleUserIdentity identity = > > (RoleUserIdentity)getRequestAttribute(Identified.IDENTITY_ATTRIBUTE_NAME); > > > the identity is null. After looking at the rife source code I found > > out that this is because my credentials manager does not implement > > IdentifiableUsersManager. So I am now wondering what does your > > de.sourcepark.ms2.rife.MS2CredentialsManagerFactory return in > > getCredentialsManager? > > Have you written your own CredentialsManager that also implements > > IdentifiableUsersManager? > > > Rodrigue > > > On Jun 19, 9:57 am, Matthias Barmeier > > <[EMAIL PROTECTED]> wrote: > > >> Hi Rodrigue, > > >> I use an entry element class as arrival: > > >> <arrival destid="EntryElement"/> > > >> The EntryElement is configured like: > > >> <element id="Entry" > >> implementation="de.sourcepark.ms2.rife.EntryElement" inherits="AuthClient"> > >> <outbean name="customer" prefix="pre_" > > >> classname="de.sourcepark.ms2.rife.customer.CBCustomerActiveEdit"/> > >> <autolink srcexit="ClientCustomerEdit"/> > >> <autolink srcexit="CustomerChangePw"/> > >> </element> > > >> In the class I can call: > > >> RoleUserIdentity identity = > >> (RoleUserIdentity)getRequestAttribute(Identified.IDENTITY_ATTRIBUTE_NAME); > > >> to get the identity object and then: > > >> identity.getLogin() > > >> To get the username. In the EntryElement you can set if you like a > >> global var to reflect the logged in user and his role. > > >> Hope this helps. > > >> Ciao > >> Matthias > > >> Rodrigue wrote: --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "rife-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rife-users?hl=en -~----------~----~----~----~------~----~------~--~---
