Changes

Jump to navigation Jump to search
677 bytes removed ,  10:58, 22 October 2018
no edit summary
* as web servlet in a [[#Servlet Container|Servlet Container]], and
* as web servlet, using [[#Maven|Maven]].
 
Authentication:
 
* If a user is defined in the <code>web.xml</code> file via the key <code>org.basex.user</code>, no password must be specified.
* If the <code>admin</code> user is specified for an API, all features will be available without restriction.
* Predefined authentication methods and default users cannot be overwritten by the client.
=Servlet Container=
Context parameters can be requested from XQuery via [[Process_Module#proc:property-names|proc:property-names]] and [[Process_Module#proc:property|proc:property]]. How to set these options is specific to the servlet container. For example, in Jetty it can be done by [http://www.eclipse.org/jetty/documentation/current/override-web-xml.html overriding the web.xml] file. Another option is to directly edit the {{Code|WEB-INF/web.xml}} file in the WAR archive (WAR files are simple ZIP files). Refer to the sample [https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/webapp/WEB-INF/web.xml web.xml] of the basex-api package.
==Authentication== Different credentials can be assigned to the REST and WebDAV a service by specifying local init parameters. In the following example, an alternative user is specified for the REST service:
<pre class="brush:xml">
</servlet>
</pre>
 
If the HTTP server is started with no pre-defined user, the credentials must be passed on by the client via [http://en.wikipedia.org/wiki/Basic_access_authentication Basic Authentication] or [http://en.wikipedia.org/wiki/Digest_authentication Digest Authentication] (depending on the server setting).
 
With cURL, internet browsers, and other tools, you can specify basic authentication credentials within the request string as plain text, using the format <code>USER:PASSWORD@URL</code>. An example:
 
: <code>http://admin:admin@localhost:8984/</code>
 
Users are specified in a {{Code|users.xml}} file, which is stored in the database directory (see [[User Management]] for more information).
==Available Services==
! Usage
|- valign="top"
| Default web server[[RESTXQ]]| {{Code|http://[host]:[port]/[servlet_context_pathservlet_path]/static}}| Access your standard Create XQuery web files (e.g. HTML, JavaScript or CSS)services and applications.
|- valign="top"
| [[RESTXQ]]
| {{Code|httpws://[host]:[port]/[servlet_context_pathservlet_path]/ws}}| Create XQuery web services and applicationsBidirectional WebSocket communication.
|- valign="top"
| [[REST]]
| {{Code|http://[host]:[port]/[servlet_context_pathservlet_path]/rest}}
| Access XML database and its resources.
|- valign="top"
| [[WebDAV]]
| {{Code|(http://[host]:[port]/[servlet_context_path]/webdav}} or<br/>{{Code|webdav)://[host]:[port]/[servlet_context_pathservlet_path]/webdav/}} (depending on client)
| Access databases via the filesystem.
|- valign="top"
| Default web server
| {{Code|http://[host]:[port]/[servlet_path]/static/}}
| Access your standard web files (e.g. HTML, JavaScript or CSS).
|}
The same options as in the case of deployment apply in a servlet container. In this case, however, there is no WAR archive. Instead, Jetty looks up all files in the directory <code>[https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/webapp basex-api/src/main/webapp]</code>. Jetty and servlet options can be configured in the {{Code|jetty.xml}} and {{Code|web.xml}} files as described above in the [[#Configuration|Servlet Container Configuration]]. The Jetty stop port can be changed in the [http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin Maven Jetty Plugin] sesion in the {{Code|pom.xml}} file.
 
=User Management=
 
By default, RESTXQ uses the admin user, whereas the REST and WebDAV services require client-side authentication.
A default user can be specified via [[Command-Line Options#BaseX HTTP Server|command-line arguments]]. In the <code>web.xml</code> file, both a global and a servlet-specific user can be added (see above).
 
If the HTTP server is started with no pre-defined user, the credentials must be passed on by the client via [http://en.wikipedia.org/wiki/Basic_access_authentication Basic Authentication] or [http://en.wikipedia.org/wiki/Digest_authentication Digest Authentication] (depending on the server setting).
 
With cURL, internet browsers, and other tools, you can specify basic authentication credentials within the request string as plain text, using the format <code>USER:PASSWORD@URL</code>. An example:
 
: <code>http://admin:admin@localhost:8984/</code>
 
Users are specified in a {{Code|users.xml}} file, which is stored in the database directory (see [[User Management]] for more information).
=Changelog=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu