password</entry><entry>Authentication password.
</entry><entry>none</entry></row>
<row><entry>
+ authenticationMode</entry><entry>How authentication is encoded.
+ </entry><entry>basic</entry></row>
+ <row><entry>
host</entry><entry>Target host. This setting is "read-only".
It's automatically set internally when connecting to a target.
</entry><entry>none</entry></row>
<sect2 id="zoom.sru.init.behavior">
<title>SRU/Solr Protocol behavior</title>
<para>
- The HTTP based protocols (SRU, SRW, Solr) doesn't feature an Inititialize Request, so
- the connection phase merely establishes a TCP/IP connection
- with the SOAP service.
+ The HTTP based protocols (SRU, SRW, Solr) doesn't feature an
+ Inititialize Request, so the connection phase merely establishes a
+ TCP/IP connection with the HTTP server.
</para>
<para>Most of the ZOOM connection options do not
affect SRU/Solr and they are ignored. However, future versions
The <literal>charset</literal> is used in the Content-Type header
of HTTP requests.
</para>
+ <para>
+ Setting <literal>authentcationMode</literal> specifies how
+ authentication parameters are encoded for HTTP. The default is
+ "<literal>basic</literal>" where <literal>user</literal> and
+ <literal>password</literal> are encoded by using HTTP basic
+ authentication.
+ </para>
+ <para>
+ If <literal>authentcationMode</literal> is "<literal>url</literal>", then
+ user and password are encoded in the URL by parameters
+ <literal>x-username</literal> and <literal>x-password</literal> as
+ given by the SRU standard.
+ </para>
</sect2>
</sect1>
<sect1 id="zoom.query"><title>Queries</title>
c->user = 0;
c->group = 0;
c->password = 0;
+ c->url_authentication = 0;
c->maximum_record_size = 0;
c->preferred_message_size = 0;
val = ZOOM_options_get(c->options, "password");
if (!val)
val = ZOOM_options_get(c->options, "pass");
-
if (val && *val)
c->password = xstrdup(val);
+ val = ZOOM_options_get(c->options, "authenticationMode");
+ if (val && !strcmp(val, "url"))
+ c->url_authentication = 1;
+ else
+ c->url_authentication = 0;
+
c->maximum_record_size =
ZOOM_options_get_int(c->options, "maximumRecordSize", 64*1024*1024);
c->preferred_message_size =
char *user;
char *group;
char *password;
+ int url_authentication;
int async;
int support_named_resultsets;
static Z_SRW_PDU *ZOOM_srw_get_pdu(ZOOM_connection c, int type)
{
Z_SRW_PDU *sr = yaz_srw_get_pdu(c->odr_out, type, c->sru_version);
- sr->username = c->user;
- sr->password = c->password;
+ if (c->url_authentication && c->user)
+ {
+ Z_SRW_extra_arg **ea = &sr->extra_args;
+ while (*ea)
+ ea = &(*ea)->next;
+ *ea = (Z_SRW_extra_arg *) odr_malloc(c->odr_out, sizeof(**ea));
+ (*ea)->name = "x-username";
+ (*ea)->value = c->user;
+ ea = &(*ea)->next;
+ if (c->password)
+ {
+ *ea = (Z_SRW_extra_arg *) odr_malloc(c->odr_out, sizeof(**ea));
+ (*ea)->name = "x-password";
+ (*ea)->value = c->password;
+ ea = &(*ea)->next;
+ }
+ *ea = 0;
+ }
+ else
+ {
+ sr->username = c->user;
+ sr->password = c->password;
+ }
return sr;
}
#endif