में वेब.एक्सएमएल में भूमिका के बिना प्रमाणीकरण एक विश्वसनीय उद्यम एप्लिकेशन के लिए मुझे सभी कॉल प्रमाणित होने की आवश्यकता है, लेकिन मैं एक सामान्य समूह/रोल्ट प्रदान नहीं कर सकता जो सिस्टम के सभी उपयोगकर्ताओं के पास है। मैं एलडीएपी को प्रमाणित और अधिकृत करता हूं (जो इस मुद्दे के लिए कोई फर्क नहीं पड़ता)।JBoss AS 7
यदि मैं नीचे दिए गए web.xml में तत्वों को छोड़ देता हूं, तो मुझे कोई प्रमाणीकरण नहीं मिलता है। मैं एक आम भूमिका की आवश्यकता के बिना प्रमाणीकरण कैसे कर सकता हूं? इसके अलावा, एक खाली लेख-विवेक काम नहीं करता है।
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<!-- fpe: This one is necessary. -->
<param-name>resteasy.role.based.security</param-name>
<param-value>true</param-value>
</context-param>
<security-constraint>
<web-resource-collection>
<web-resource-name>Resteasy</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<!-- <auth-constraint> -->
<!-- <role-name>*</role-name> -->
<!-- </auth-constraint> -->
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Login</realm-name>
</login-config>
<!-- <security-role> -->
<!-- <role-name>the_common_role</role-name> -->
<!-- </security-role> -->
</web-app>
* ठीक से करता है चाल का उपयोग करना:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<!-- fpe: This one is necessary. -->
<param-name>resteasy.role.based.security</param-name>
<param-value>true</param-value>
</context-param>
<security-constraint>
<web-resource-collection>
<web-resource-name>Resteasy</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Login</realm-name>
</login-config>
<security-role>
<role-name>*</role-name>
</security-role>
</web-app>