Persistent login with UserManager, Collections, and Scheduler plugins

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Persistent login with UserManager, Collections, and Scheduler plugins

Alister Pillow-3
There is a a simple workaround for the Persistent login problem in the Dashboard (eXist-db v3+). This might be close to the “correct” solution.
The UserManager, Collections and Scheduler don’t call the login module directly so they run as “guest”, so declaring a variable which performs the login using the request attributes will solve this.

Add this variable to the prolog of service.xql (for scheduler and browsing) and userManager.xqm (change the namespace accordingly).

declare variable $service:user  := if (request:get-attribute(‘xquery.user')) then (
        let $log-in := xmldb:login('/db', request:get-attribute('xquery.user'),request:get-attribute('xquery.password'))
        return request:get-attribute('org.exist.login.user')
        ) else "guest”;

Regards,
Alister


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Persistent login with UserManager, Collections, and Scheduler plugins

Alister Pillow-3
Apologies - please ignore this for the moment. I’ve used a clean build of 3.1.1 and this fix doesn’t seem to work.

> On 23 Mar 2017, at 7:11 am, Alister Pillow <[hidden email]> wrote:
>
> There is a a simple workaround for the Persistent login problem in the Dashboard (eXist-db v3+). This might be close to the “correct” solution.
> The UserManager, Collections and Scheduler don’t call the login module directly so they run as “guest”, so declaring a variable which performs the login using the request attributes will solve this.
>
> Add this variable to the prolog of service.xql (for scheduler and browsing) and userManager.xqm (change the namespace accordingly).
>
> declare variable $service:user  := if (request:get-attribute(‘xquery.user')) then (
>        let $log-in := xmldb:login('/db', request:get-attribute('xquery.user'),request:get-attribute('xquery.password'))
>        return request:get-attribute('org.exist.login.user')
>        ) else "guest”;
>
> Regards,
> Alister
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...