web http basic authentication

在项目中的web.xml文件中添加如下代码:



Monitor Page
/*


admin



BASIC
monitor


admin

在jetty.xml文件中添加:




monitor
/appconfig/realm.properties
5


在appconfig文件夹下创建realm.properties属性文件,并添加如下内容:

realm账号形式:# : [, ...]

The format is

: [, ...]

Passwords may be clear text, obfuscated or checksummed. The class

org.eclipse.util.Password should be used to generate obfuscated

passwords or password checksums

If DIGEST Authentication is used, the password must be in a recoverable

format, either plain text or OBF:.

jetty: MD5:164c88b302622e17050af52c89945d44,user
admin: CRYPT:adpexzg3FUZAk,server-administrator,content-administrator,admin,user
other: OBF:1xmk1w261u9r1w1c1xmq,user
plain: plain,admin

使用curl命令的访问方式

curl -k -u user:password https://192.168.10.74:8843/barometer/toPages/toHostList.action

curl -k -u user:password https://192.168.10.74:8843/barometer/monitorIndexAction/toMonitorPage.action?ip=192.168.187.45

你可能感兴趣的:(web http basic authentication)