有很好的教程 Basic Authentication with JAX-WS
但它描述了基于 Web 的应用程序(战争)的部署描述。在 ejb jar 部署描述中描述是否可以通过?
对于 web.xml
<security-constraint>
<display-name>SecurityConstraint</display-name>
<web-resource-collection>
<web-resource-name>WRCollection</web-resource-name>
<url-pattern>/hello</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>TutorialUser</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-constraint>BASIC</auth-constraint>
<realm-name>file</realm-name>
</login-config>
<security-role>
<role-name>TutorialUser</role-name>
</security-role>
我通过注释找到了安全规则的描述 -
GlassFish 和 Java EE 5 SDK 中的安全注释和授权
但这足够了吗?
比你!