User and Password in REST URL
Tuesday, 3 May 2016 · 3 messages · last reply 4 May 2016
MC
Mike Cobo3 May 2016 18:19 #
Hi all
When invokling an XQuery via REST, eg. http://mydomain.com:8984/rest?run=scripts/myscript.xq I'm prompted to type in the user and password for authentication. This is ok when a script needs user authentication to connect to a database. But when the script only uses the XQuery processor to output a (generated) HTML page it would be easier if the user authentication could by included in the URL, eg http://mydomain.com:8984/rest?run=scripts/myscript.xq&user=tester&password=pwd
Is there a way to bypass the authentication dialog this way? I tried with the parameters "user" and "password" as shown in the example above, but this dosn't work. ThnxMike
CG
Christian Grün3 May 2016 21:56 #
Hi Mike,
If you use basic authentication (which is the default), you can specify your credentials in the URL:
http://tester:pwd at mydomain.com:8984/rest?run=scripts/myscript.xq
Hope this helps,
Christian
Quoted text · Mike Cobo · 19 lines
On Tue, May 3, 2016 at 6:19 PM, Mike Cobo <mikecobo at yahoo.com> wrote: > Hi all > > When invokling an XQuery via REST, eg. > http://mydomain.com:8984/rest?run=scripts/myscript.xq I'm prompted to type > in the user and password for authentication. > This is ok when a script needs user authentication to connect to a database. > But when the script only uses the XQuery processor to output a (generated) > HTML page it would be easier if the user authentication could by included in > the URL, eg > > http://mydomain.com:8984/rest?run=scripts/myscript.xq&user=tester&password=pwd > > Is there a way to bypass the authentication dialog this way? I tried with > the parameters "user" and "password" as shown in the example above, but this > dosn't work. > > Thnx > Mike
MC
Mike Cobo4 May 2016 10:44 #
Hi Christian
Thanks for your hint, - this is exactly what I was looking for!
Regards,Mike
From: Christian Grün <christian.gruen at gmail.com>
To: Mike Cobo <mikecobo at yahoo.com>
Cc: "basex-talk at mailman.uni-konstanz.de" <basex-talk at mailman.uni-konstanz.de> Sent: Tuesday, May 3, 2016 9:56 PM
Subject: Re: [basex-talk] User and Password in REST URL
Hi Mike,
If you use basic authentication (which is the default), you can specify your credentials in the URL:
http://tester:pwd at mydomain.com:8984/rest?run=scripts/myscript.xq
Hope this helps,
Christian
Quoted text · Mike Cobo · 19 lines
On Tue, May 3, 2016 at 6:19 PM, Mike Cobo <mikecobo at yahoo.com> wrote: > Hi all > > When invokling an XQuery via REST, eg. > http://mydomain.com:8984/rest?run=scripts/myscript.xq I'm prompted to type > in the user and password for authentication. > This is ok when a script needs user authentication to connect to a database. > But when the script only uses the XQuery processor to output a (generated) > HTML page it would be easier if the user authentication could by included in > the URL, eg > > http://mydomain.com:8984/rest?run=scripts/myscript.xq&user=tester&password=pwd > > Is there a way to bypass the authentication dialog this way? I tried with > the parameters "user" and "password" as shown in the example above, but this > dosn't work. > > Thnx > Mike
Written for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery