Quantcast
Channel: Java mon amour
Viewing all articles
Browse latest Browse all 1124

WebLogic "run as" webApplication

$
0
0
Here http://docs.oracle.com/cd/E11035_01/wls100/security/thin_client.html#wp1046373 you find an example on how to attach a principal to a webapp request, without having to explicitly passing it like in:

curl -u username:password url

it works like a breeze

weblogic.xml:


<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<context-root>gridlinkha</context-root>
<run-as-role-assignment>
<role-name>hypericrole</role-name>
<run-as-principal-name>weblogic</run-as-principal-name>
</run-as-role-assignment>
</weblogic-web-app>




web.xml:



<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app 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_2_5.xsd"
version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
<servlet>
<servlet-name>FCFHAServlet</servlet-name>
<servlet-class>oracle.support.ha.FCFHAServlet</servlet-class>
<run-as>
<role-name>hypericrole</role-name>
</run-as>
</servlet>
<security-role>
<role-name>hypericrole</role-name>
</security-role>
<servlet-mapping>
<servlet-name>FCFHAServlet</servlet-name>
<url-pattern>/fcfhaservlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/index.html</welcome-file>
</welcome-file-list>
</web-app>



Viewing all articles
Browse latest Browse all 1124

Latest Images

Trending Articles



Latest Images