Hi Ray,

if you want to customize the authentication behavior and adapt your template, you're following the right path. However, don't create your own processElement method. The Authenticated elements has a whole bunch of hooks:

initializeAuthentication()
entrance(Template template)
unvalidatedCredentials(Template template, Credentials credentials)
validatedCredentials(Credentials credentials)
acceptedCredentials(Credentials credentials)
authenticated(long userId)
refusedCredentials(Template template, Credentials credentials)
sessionCreationError(Template template, Credentials credentials)
sessionNotValid(String childTriggerName, String[] childTriggerValues, int validityId)

Both refusedCredentials and sessionCreationError have default implementations that set the appropriate validation errors in the template, so if you want to preserve this, you need to call the super method in your own version.

More info here:
http://rifers.org/wiki/display/RIFE/Authentication+system+internals

Hope this helps.

Geert

On 06 Feb 2007, at 04:27, Ray Vanderborght wrote:

I've got a database authentication element setup like below and I'm trying to set some of my own block values in the tempate... it's unclear how you accomplish that though. I tried extending database.xml with my own element and overriding processElement, haven't hit on the right way to do this yet..

<element id="AuthLogin" extends="rife/authenticated/database.xml">
    <property name="template_name"> authentication.admin</property>
    <property name="role">user</property>
<property name="datasource"><datasource>derby</datasource></ property>
    <property name="authvar_type">cookie</property>

    <submission name="credentials">
        <param name="login"/>
        <param name="password"/>
    </submission>

    <childtrigger name="authid"/>
</element>

I changed AuthLogin to extend this instead:
<element extends="rife/authenticated/database.xml" implementation="elements.setup.Login">
</element>

My own Login class extends PurgingDatabaseAuthenticated and overrides processElement() to try to add to the template, but so far no go. Maybe I'm headed down the wrong path?


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to