diff --git a/client/client.c b/client/client.c index 369564a1..0bea14c4 100644 --- a/client/client.c +++ b/client/client.c @@ -784,7 +784,7 @@ static int cmd_authentication(const char *arg) int r; nmem_reset(nmem_auth); - nmem_strsplit_blank(nmem_auth, arg, &args, &r); + nmem_strsplit_escape2(nmem_auth, " ", arg, &args, &r, 1, '\\', 1); if (r == 0) { diff --git a/doc/yaz-client-man.xml b/doc/yaz-client-man.xml index fe088922..f313a1bd 100644 --- a/doc/yaz-client-man.xml +++ b/doc/yaz-client-man.xml @@ -385,18 +385,34 @@ - authentication openauth + authentication [auth1 [auth2 [auth3]]] - Sets up an authentication string if a server requires - authentication (v2 OpenStyle). The authentication string is first + Configures authentication strings to be sent to server. Zero, 1, 2 or 3 arguments may follow the + auth command. + + If no (0) arguments are given, no authentication string is sent. + If one argument is given, the Z39.50 v2 OpenStyle authentication is used. + A common convention for the auth1 string + is that the username and password is separated by a slash, e.g. + myusername/mysecret. + + + If two or more arguments is given Z39.50 v3 authentication is used, in which cased the + first argument is used, second argument is group and third argument is password. If only two arguments are given + the group is assumed to be empty. + + + As for other commands in yaz-client, the arguments are separated by whitespace. A backslash character can be used to include + a character verbatim. For example, auth myuser a\ b is a two argument auth command where user is + myuser and password is a b. + + + The authentication string is first sent to the server when the open command is issued and the Z39.50 Initialize Request is sent, so this command must be used before open in order to be effective. - A common convention for the authopen string - is that the username - and password is separated by a slash, e.g. - myusername/mysecret.