diff --git a/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java b/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java index 4b84b5f7e0..eb3da68bf5 100644 --- a/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java +++ b/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java @@ -148,7 +148,10 @@ public class CLIRegisterer extends ExtensionFinder { // fill up all the binders parser.parseArgument(args); - sc.setAuthentication(authenticator.authenticate()); // run the CLI with the right credential + Authentication auth = authenticator.authenticate(); + if (auth==Hudson.ANONYMOUS) + auth = loadStoredAuthentication(); + sc.setAuthentication(auth); // run the CLI with the right credential hudson.checkPermission(Hudson.READ); // resolve them