Your client code should send necessary authentication information to access=
the resource. Otherwise the server will challenge the client with a 401. Y=
ou may want to compare the HTTP requests made from the browser and your cli=
ent.
This is a discussion on 401 Unauthorized error over port 80 between two WLS 10 servers - Weblogic ; I am getting a "'401: Unauthorized' for url: 'http://10.160.48.41:80/servle= t/GatewayServlet" error when I try to access one of my servlets. This serv= let is not constrained in my web.xml file. I am using WLS 10 When I deplo= yed my ...
I am getting a "'401: Unauthorized' for url: 'http://10.160.48.41:80/servle=
t/GatewayServlet" error when I try to access one of my servlets. This serv=
let is not constrained in my web.xml file. I am using WLS 10 When I deplo=
yed my web application, I selected the Deployment Descriptor Only option fo=
r my security realm. =20
My goal is to have two servers running WLS with my web applications communi=
cating with each other. I don't want to make individual server accounts fo=
r the server interactions (pushing data to each other). I plan to use two =
way SSL with server certificates. For Client API calls to the servlets, I =
will use container manage security for that servlet via WLS-Active Director=
y.=20
The intersting part regarding this is I can access a different method in th=
e same servlet using a web browser.
If there is any other information that you may need to help me with this is=
sue please let me know through this posting.
Any help will be much appreciated.
Thanks,
Tung
Here is a copy of my web.xml file:
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.=
3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>GatewayServlet</servlet-name>
<servlet-class>
mil.navy.nrlssc.dmap.TEDServices.Server.GatewayServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>GatewayServletCM</servlet-name>
<servlet-class>
mil.navy.nrlssc.dmap.TEDServices.Server.GatewayServlet
</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>GatewayServletROS</servlet-name>
<servlet-class>
mil.navy.nrlssc.dmap.TEDServices.ROS.GatewayServletROS
</servlet-class>
<load-on-startup>3</load-on-startup>=20
</servlet>
<servlet-mapping>
<servlet-name>GatewayServlet</servlet-name>
<url-pattern>/GatewayServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GatewayServletCM</servlet-name>
<url-pattern>/GatewayServletCM</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GatewayServletROS</servlet-name>
<url-pattern>/GatewayServletROS</url-pattern>
</servlet-mapping>
<security-constraint>
=09 <web-resource-collection>
<web-resource-name>VNEGWYAPIServlets</web-resource-name>
=09=09 <description>
=09=09=09 This web resource collection places a security constraint to use=
container managed security for access to all VNE-NCS gateway servlets that=
are used by the API.=09=09 </description>
<url-pattern>/GatewayServletCM</url-pattern>
</web-resource-collection>
<auth-constraint>
<description>
Security roles that are granted here should be mapped to=20
groups in the weblogic.xml file. =20
</description>
<role-name>VNEGWYCustomer</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>myrealm</realm-name>
</login-config>
<security-role>
<role-name>VNEGWYCustomer</role-name>
</security-role>
</web-app>
--
Edited by tungpham at 01/07/2008 1:41 AM
Your client code should send necessary authentication information to access=
the resource. Otherwise the server will challenge the client with a 401. Y=
ou may want to compare the HTTP requests made from the browser and your cli=
ent.