import{_ as s,o as i,c as o,a as e,b as r,d as a,e as n,r as c}from"./app.977e81c1.js";const d={},l=a(`

auth

TIP

Authenticates the current session

Configure username and password

When attaching, you can specify a password on the command line. such as:

java -jar arthas-boot.jar --password ppp

Local connection does not require authentication

By default, there are configurations in the arthas.properties file:

arthas.localConnectionNonAuth=true

When the password is configured, connect from localhost, the authentication is not required. The default configuration value is true, which is convenient for local connection. Authentication is only required when connecting remotely.

Authenticate in the telnet console

After connecting to arthas, directly executing the command will prompt for authentication:

[arthas@37430]$ help
Error! command not permitted, try to use 'auth' command to authenticates.

Use the auth command to authenticate, and you can execute other commands after success.

[arthas@37430]$ auth ppp
Authentication result: true

Web console Authentication

Open the browser, there will be a pop-up window prompting you to enter your username and password.

After success, you can directly connect to the web console.

HTTP API Authentication

Arthas uses the HTTP standard Basic Authorization.

`,22),u=n("Reference: "),h={href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication",target:"_blank",rel:"noopener noreferrer"},p=n("https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication"),m=a(`

For example, if the user name is: admin and the password is admin, the combination is a string: admin:admin, the base64 result is: YWRtaW46YWRtaW4=, then the HTTP request adds the Authorization header:

curl 'http://localhost:8563/api' \\
  -H 'Authorization: Basic YWRtaW46YWRtaW4=' \\
  --data-raw '{"action":"exec","command":"version"}'

URL parameters

It supports passing username and password in parameters. such as:

curl 'http://localhost:8563/api?password=admin' \\
  --data-raw '{"action":"exec","command":"version"}'
`,5);function v(b,g){const t=c("ExternalLinkIcon");return i(),o("div",null,[l,e("ul",null,[e("li",null,[u,e("a",h,[p,r(t)])])]),m])}const x=s(d,[["render",v],["__file","auth.html.vue"]]);export{x as default};