diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-07-07 00:14:13 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-07-30 11:21:58 -0500 |
commit | 2d427ce0008fb43ae9f6c02301ce6793a42904b9 (patch) | |
tree | 053fbdd575aae8dd06a8e8b90f39b6060d7b635d /base/common/src/com/netscape/cms/client/cli/MainCLI.java | |
parent | c4636a5b56bd3e0f18fb3afd0b930729d58ce1f6 (diff) | |
download | pki-2d427ce0008fb43ae9f6c02301ce6793a42904b9.tar.gz pki-2d427ce0008fb43ae9f6c02301ce6793a42904b9.tar.xz pki-2d427ce0008fb43ae9f6c02301ce6793a42904b9.zip |
Added support for basic authentication.
The CMSRestClient has been modified to support basic authentication
and handle HTTP redirection. The basic authentication can be used as
follows:
pki -U <server uri> -u <username> -w <password> user-find
Some protected REST services might require secure connection. If the
user tries to call these services over HTTP the CLI will handle the
redirection automatically to an HTTPS port.
Ticket #107
Diffstat (limited to 'base/common/src/com/netscape/cms/client/cli/MainCLI.java')
-rw-r--r-- | base/common/src/com/netscape/cms/client/cli/MainCLI.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/cms/client/cli/MainCLI.java b/base/common/src/com/netscape/cms/client/cli/MainCLI.java index 0367cbbfd..50c90d892 100644 --- a/base/common/src/com/netscape/cms/client/cli/MainCLI.java +++ b/base/common/src/com/netscape/cms/client/cli/MainCLI.java @@ -107,6 +107,10 @@ public class MainCLI extends CLI { option.setArgName("nickname"); options.addOption(option); + option = new Option("u", true, "Username"); + option.setArgName("username"); + options.addOption(option); + option = new Option("w", true, "Password"); option.setArgName("password"); options.addOption(option); @@ -131,6 +135,7 @@ public class MainCLI extends CLI { String certDatabase = cmd.getOptionValue("d"); String certNickname = cmd.getOptionValue("n"); + String username = cmd.getOptionValue("u"); String password = cmd.getOptionValue("w"); // convert into absolute path @@ -140,6 +145,9 @@ public class MainCLI extends CLI { if (certNickname != null) config.setCertNickname(certNickname); + if (username != null) + config.setUsername(username); + if (password != null) config.setPassword(password); } |