I am having some trouble getting RIFE's memory users authentication to work.  
My application is a reporting package which will eventually have 
database-driven authentication.  However, in order to get there, I have to 
set up the user/role tables in Postgresql.  I have written a Java backend 
which will hopefully do this, and I want access to this functionality to be 
restricted via an admin user whose details are held in rep/users.xml.  I am 
getting to the point where my site entry menu comes up ok, and clicking on 
its "install" link gives me the correct login page as expected.  I then enter 
the correct details (using clear text passwords for now, eventually want 
MD5).  RIFE then checks the details against the users file and I continually 
get the "invalid user details" message (<!--B 'INVALID:credentials'-->Invalid 
user details<!--/B--> has been invoked).  Looking at what's sent over HTTP I 
see:

login    : admin        
password        : thepassword   
triggerlist :           
childrequest : dXNlcnNldHVwL2luc3RhbGwueG1seABHRVRtAA== 
submissioncontext : LklOU1RBTExeLkFVVEhNRU0=    
submission : credentials        

all of which seem correct to me.  I have appended the relevant files I'm using 
to the end of this message.  I'm at a loss as to why seemingly correct 
details are rejected, and how I might go about debugging this.  Can anyone 
help?

Thanks,

David Herbert.

sites/locreport.xml
----------------------------------------------------------
<!DOCTYPE site SYSTEM "/dtd/site.dtd">
<site>
    <globalvar name="authid"/>
    <arrival destid="USERSETUP"/>
    <element id="AUTHMEM" file="authmem.xml"/>
    <element id="USERSETUP" extends="rife/template/print.xml" 
url="/usersetup">
        <property name="name">usersetup.home</property>
        <exit name="install"/>
        <flowlink srcexit="install" destid="INSTALL"/>
    </element>
    <element id="INSTALL" file="usersetup/install.xml" url="/install" 
inherits="AUTHMEM"/>
</site>

rep/participants.xml:
-----------------------------------------------------------
<!DOCTYPE rep SYSTEM "/dtd/rep.dtd">
<rep>
    <participant param="rep/users.xml">ParticipantMemoryUsers</participant>
    <participant param="rep/config.xml">ParticipantConfig</participant>
    <participant 
param="rep/datasources.xml">ParticipantDatasources</participant>
    <participant param="sites/locreport.xml">ParticipantSite</participant>
</rep>

elements/authmem.xml:
---------------------------------------------------------
<!DOCTYPE element SYSTEM "/dtd/element.dtd">
<element extends="rife/authenticated/memory.xml">
    <property name="template_name">usersetup.login</property>
    <property name="role">admin</property>
    <submission name="credentials">
        <param name="login"/>
        <param name="password"/>
    </submission>
</element>

elements/usersetup/install.xml:
----------------------------------------------------------
<!DOCTYPE element SYSTEM "/dtd/element.dtd">
<element implementation="uk.co.communitytech.InstallUserTables">
    <property name="name">usersetup.install</property>
</element>

rep/users.xml:
-----------------------------------------------------------
<!DOCTYPE credentials SYSTEM "/dtd/users.dtd">
<credentials>
    <user login="admin">
        <password>thepassword</password>
        <role>admin</role>
    </user>   
</credentials>

templates/usersetup/autherror.html:
------------------------------------------------------------
<!--V 'ERRORS:*'--><!--/V-->
<!--B 'ERRORS:*'-->    
    <!--V 'error_header'--><b>Errors occured</b><!--/V--><br/>
    <span style="color:red">
    <!--V 'ERRORS'--><!--/V-->
    <!--B 'ERRORMESSAGE:*'--><!--V 'ERRORMESSAGE'--><!--/V--><br/><!--/B-->
    </span>
    <br/>
<!--/B-->
<!--B 'MARK:ERROR'--> style="color: red; font-weight: bold;"<!--/B-->
<!--B 'UNEXPECTED:sessioncreation'-->An unexpected error occurred which 
prevented the session from being started.<!--/B-->
<!--B 'INVALID:credentials'-->Invalid user details<!--/B-->
<!--B 'MANDATORY:login'-->Please enter a username<!--/B-->
<!--B 'MANDATORY:password'-->Please enter a password<!--/B-->

templates/usersetup/login.html:
------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
    <head>
        <title>User table setup - administrator login</title>
    </head>
<body>
    <h2>User table setup - administrator login</h2>
    <!--I 'usersetup.autherror'/-->
    <form name="credentials" action="[!V 'SUBMISSION:FORM:credentials'/]" 
method="post">
    <!--V 'SUBMISSION:PARAMS:credentials'/-->
    <table border="0" cellpadding="2" cellspacing="0" summary="Login area">
        <tr>
            <td>Username</td>
            <td><input name="login" value="[!V 'PARAM:login'][!/V]" 
type="text" size="12" maxlength="10" /></td>
        </tr>
        <tr>
            <td>Password</td>
            <td><input name="password" type="password" size="12" 
maxlength="20" /></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="Login" /></td>
        </tr>
    </table>
    </form>
</body>
</html>


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

Reply via email to