Authentication where the user profiles live in the eXist-db?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Authentication where the user profiles live in the eXist-db?

darrencruse
I was hoping to use an Orbeon XForm for user registration with their user info winding up in eXist as xml.

With subsequent login authentication making use of that and restricting access to (other) Orbeon forms accordingly.

Going over the java authentication example (using Tomcat) with users living in that tomcat-users.xml file works fine.

But I'm not seeing anything able to draw user profile info from eXist.

Has anybody done this - any tips? :)

Otherwise can someone suggest an alternative - e.g. it seems overkill but I guess I could use a relational database *just* for the user profile info?  i.e. so I could configure and use a "JDBCRealm" for authentication?

(but so far I've been liking this new world/new idea of *only* XML no RDBMS!! :)

Thanks,

Darren
Reply | Threaded
Open this post in threaded view
|

Re: Authentication where the user profiles live in the eXist-db?

Rolf
Hi Darren,
 
One possible approach for XFORMS - eXist authentication ( for cases where integration is fully REST / based )
 
- Create an XFORMS section ( <xforms:case id="login" selected="true" ) with input fields for login and passwords. Something like this
 
 <xforms:case id="loginmode" selected="true"><strong>Please provide username and password to login</strong><br/>
<table class="loginbox"><tr><td class="loginbox" width="20%">User Name</td><td class="loginbox" width="20%"><xforms:input class="input-user" id="login-user" ref="instance('i-settings')/username"/></td><td class="loginbox"/></tr><tr><td class="loginbox">User Password</td><td class="loginbox"><xforms:secret class="input-user" ref="instance('i-settings')/password"/></td><td class="loginbox"/></tr></table><br/><xforms:trigger ref="instance('i-triggers')/login-trigger"><xforms:label>Login</xforms:label><xforms:action ev:event="DOMActivate"><xforms:send submission="login-submission"/></xforms:action></xforms:trigger></xforms:case>

 
- Create the submit ( linked to login ) as below. Note the use of xxforms:username and xxforms:password; these fields are passed on to eXist and will be used by eXist for authentication. If the REST call succeeds then the app (using a toggle case) can switch to a different mode ( = login has succeeded ). If authenticatio fails, the submit fails, app issues a warning, and the user remains in login mode. Use the same xxusername/xxpassword in all eXist REST submits so that on each call eXist will auto authenticate:
 
 <xforms:submission id="login-submission" instance="i-login-response" method="get" ref="instance('i-settings')" relevant="true" replace="instance" resource="http://ueno.homelinux.net:8080/exist/rest/db/metadata/mini/scripts/mini.count.xq?" validate="true" xxforms:password="{instance('i-settings')/password}" xxforms:username="{instance('i-settings')/username}">
        <xforms:message ev:event="xforms-submit-error" level="modal">Login Error</xforms:message>
        <xforms:action ev:event="xforms-submit-done" ev:observer="login-submission">
          <xforms:toggle case="initmode"/>
        </xforms:action>
      </xforms:submission>

 
- See below for an example of a login script. Successful execution means that the user has successfully logged in against a valid eXist userid.

xquery version "1.0";
declare option exist:serialize "method=xml media-type=text/xml indent=yes";
declare namespace  xdb="http://exist-db.org/xquery/xmldb";
let $collection-path := "/db/metadata/mini/data"
return
<instance><count>{
count(collection($collection-path))
}</count></instance>

 
- The above assumes you have an instance i-settings with username and password fields.
 
     <xforms:instance id="i-settings" xxforms:exclude-result-prefixes="#all">
        <instance xmlns="">
          <username/>
          <password/
        </instance>
      </xforms:instance>  

- Rolf

 
On Fri, Sep 24, 2010 at 4:03 AM, darrencruse <[hidden email]> wrote:

I was hoping to use an Orbeon XForm for user registration with their user
info winding up in eXist as xml.

With subsequent login authentication making use of that and restricting
access to (other) Orbeon forms accordingly.

Going over the java authentication example (using Tomcat) with users living
in that tomcat-users.xml file works fine.

But I'm not seeing anything able to draw user profile info from eXist.

Has anybody done this - any tips? :)

Otherwise can someone suggest an alternative - e.g. it seems overkill but I
guess I could use a relational database *just* for the user profile info?
i.e. so I could configure and use a "JDBCRealm" for authentication?

(but so far I've been liking this new world/new idea of *only* XML no
RDBMS!! :)

Thanks,

Darren

--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Authentication-where-the-user-profiles-live-in-the-eXist-db-tp2552621p2552621.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Authentication where the user profiles live in the eXist-db?

darrencruse
Thanks so much for your reply Rolf I hadn't seen it till now.  

To be honest since I wrote my original post I'd started pursuing the path of using Orbeon with LifeRay portal where LifeRay would wind up handling the A&E/login/protection stuff.  But even with that approach I'm a little disappointed the users would wind up in MySQL not eXist, so there's still a chance your comments could help me (I'm honestly not sure where I'm at right now since I'm struggling with LifeRay/Orbeon integration as well).  But obviously others may benefit too so thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Re: Authentication where the user profiles live in the eXist-db?

Erik Bruchez
Administrator
Darren,

It would be cool to integrate with eXist.

Can you ask on the eXist mailing-list whether there is a Tomcat realm
for eXist and what its status is? I think there was such a thing at
some point.

-Erik

On Wed, Oct 6, 2010 at 8:29 AM, darrencruse <[hidden email]> wrote:

>
> Thanks so much for your reply Rolf I hadn't seen it till now.
>
> To be honest since I wrote my original post I'd started pursuing the path of
> using Orbeon with LifeRay portal where LifeRay would wind up handling the
> A&E/login/protection stuff.  But even with that approach I'm a little
> disappointed the users would wind up in MySQL not eXist, so there's still a
> chance your comments could help me (I'm honestly not sure where I'm at right
> now since I'm struggling with LifeRay/Orbeon integration as well).  But
> obviously others may benefit too so thanks.
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Authentication-where-the-user-profiles-live-in-the-eXist-db-tp2552621p2965176.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws