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: > > Hi Matthias, > > > Thank you for your reply. I actually have the authentication working > > as well. However I am now struggling to set and get values in the > > session once the authentication is successful. Basically, once the > > credentials are checked and correct, I want to add 2 variables in the > > session so that all the elements in the subsite that inherits from > > AUTH can have access to them. > > > I thought this should be done with global variables but I don't know > > how to set and get them. I have tried to extend the > > RoleUserAuthenticated class and do a setOutput() inside the > > acceptedCredentials() hook. I ran into an exception saying "beanClass > > cannot be null" thrown by ElementSupport.generateEmptyForm(). > > > Are you trying to do something similar with your inbean and outbean? > > If so, how does the inbean gets created and populated? > > > I have spent a few hours reading the wiki, the cookbook, the javadoc, > > the source code, and I am now confused on how to do what I want. Also, > > how to get access to the credentials object from an element that > > inherits from AUTH? It seems tht it is possible only if you have the > > 'login' value...Really, I don't know where to look now. > > > I'd really appreciate any help. > > > Rodrigue > > > On Jun 18, 5:02 pm, Matthias Barmeier > > <[EMAIL PROTECTED]> wrote: > > >> Hi, > > >> I have written a CredentialsManager to. I am not sure how this rife > >> magic works but this is my configuration: > > >> main.xml: > > >> <element id="AuthClient" extends="rife/authenticated/memory.xml"> > >> <property name="password_encryption">SHA</property> > >> <property name="role">Client,Admin</property> > >> <!-- <property name="role">Admin</property> --> > >> <property name="authvar_type">cookie</property> > >> <property name="template_name">authentication.admin</property> > >> <property > >> name="credentialsmanagerfactory_class">de.sourcepark.ms2.rife.MS2CredentialsManagerFactory</property> > >> <submission name="credentials"> > >> <param name="login"/> > >> <param name="password"/> > >> </submission> > > >> <childtrigger name="authid"/> > >> </element> > > >> <element id="CustomerChangePw" > > >> implementation="de.sourcepark.ms2.rife.customer.EditCustomerPw" > >> url="/customerchangepw" inherits="AuthClient"> > >> <inbean name="customer" prefix="pre_" > > >> classname="de.sourcepark.ms2.rife.customer.CBCustomerPwEdit"/> > >> <outbean name="customer" prefix="pre_" > > >> classname="de.sourcepark.ms2.rife.customer.CBCustomerActiveEdit"/> > >> <autolink srcexit="ClientCustomerEdit"/> > >> <autolink srcexit="CustomerChangePw"/> > > >> </element> > > >> this works perfect for me. > > >> Hope this helps. > > >> Ciao > >> Matthias > > >> Rodrigue wrote: > > >>> Hi, > > >>> I am working on my first Rife project and I need to authenticate my > >>> users against a SOAP server. To do this, assuming I have understood > >>> the way it works, I have written a class that implements > >>> CredentialsManagerFactory to return my own CredentialsManager. I have > >>> added a credentialsmanagerfactory_class property to my authentication > >>> element. I have two questions though: > > >>> - Should I use the memory-based or the db authentication? Does it > >>> matter at all since I won't use either the users xml file or the user > >>> table? Or should I not add any participant for the authentication in > >>> my participants.xml? > >>> - If I need to declare a participant, how should I declare it? No > >>> users.xml param or no datasource? > > >>> Rodrigue --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
