我正在編寫管理webapp以部署在Wildfly上。 它將由有權訪問管理控制檯的相同用戶使用(http://localhost:9990/)。 如果我可以聲明我的應用程序應該在ManagementRealm中使用HTTP基本身份驗證,就像Console一樣,那將是非常好的選擇。Wildfly上的ManagementRealm中的web應用程序
天真,樂觀的嘗試沒有成功:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<security-constraint>
<web-resource-collection>
<web-resource-name>Admin Panel</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>ManagementRealm</realm-name>
</login-config>
</web-app>
這並不是在所有觸發HTTP基本登錄對話框。 有沒有簡單的方法將我的應用程序插入ManagementRealm?