Getting 401 Unauthorized error while trying to launch Jenkins slave via command line through JNLP using -secret option Getting 401 Unauthorized error while trying to launch Jenkins slave via command line through JNLP using -secret option jenkins jenkins

Getting 401 Unauthorized error while trying to launch Jenkins slave via command line through JNLP using -secret option


I think that your issue may come from a security management.Have you enable TCP port for JNLP agents in your Global Security ?

Go to Manage Jenkins > Global Security, Enable TCP port for JNLP agents, select Fixed and fill the port you used in your jnlpUrl, then select Java Web Start Agent Protocol/4 and save your config.

Further documentation here.


I had a similar problem. I resolved it by allowing anonymous access to Jenkins (the option is available in Manage Jenkins page, Kerberos properties section - we use Kerberos Single Sign-On plugin for Jenkins authentication, so not sure how would other authentication plugins work).

I'd also recommend limiting the scope of anonymous access if you enable it.