I just copied my users section in the tomcat-users. There is more code - Tomcat 
users tag.. that shouldn’t be the problem cause I can enter to the tomcat 
manager page

> On 23 Apr 2018, at 16:45, Christopher Schultz <ch...@christopherschultz.net> 
> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Zahi,
> 
>> On 4/23/18 9:38 AM, Zahi Fail wrote:
>> I'm working with Tomcat 9.0.6 version as my servlet, Throughout my
>> jax-rs project i have tried to create basic authentication.
>> 
>> While i'm trying to access a post method without the basic auth. it
>> all working well (I got the 200 message from the HTTP server). But,
>> after adding the basic auth. my user name and password doesn't work
>> from some reason..
>> 
>> 
>> This is the following code from my web.xml file:
>> 
>> <?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"; id="WebApp_ID"
>> version="3.0"> <display-name>User Management</display-name> 
>> <servlet> <servlet-name>Jersey RESTful Application</servlet-name> 
>> <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-
> class>
>> 
>> 
> <init-param>
>> <param-name>jersey.config.server.provider.packages</param-name> 
>> <param-value>com.journaldev.jaxws.beans</param-value> 
>> </init-param> </servlet> <servlet-mapping> <servlet-name>Jersey
>> RESTful Application</servlet-name> 
>> <url-pattern>/rest/*</url-pattern> </servlet-mapping> 
>> <security-constraint> <web-resource-collection> 
>> <web-resource-name>simple web resource</web-resource-name> 
>> <url-pattern>/rest/Traffic/*</url-pattern> 
>> <http-method>POST</http-method> </web-resource-collection> 
>> <auth-constraint> <role-name>manager</role-name> 
>> </auth-constraint> <user-data-constraint> 
>> <transport-guarantee>NONE</transport-guarantee> 
>> </user-data-constraint> </security-constraint> <login-config> 
>> <auth-method>BASIC</auth-method> </login-config> </web-app>
>> 
>> 
>> 
>> *and in the tomcat-user.xml i have updated the code as below: *
>> 
>> <role rolename="manager-gui"/> <role rolename="manager-status"/> 
>> <role rolename="manager-script"/> <role rolename="manager"/> <user
>> username="tomcat" password="s3cret" roles="manager-gui"/> <user
>> username="admin" password="falcon" roles="manager"/>
> 
> Your tomcat-user.xml file is not a valid XML document.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> 
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrd42sACgkQHPApP6U8
> pFgd5g//RbtTrIYovq1dF9AfNcDJWD7uT7d3v3PVidCRY+Z+QRUdrRnAXjBwWy/0
> jtUcyDmOcTqSbptA9QXWn84XZFv+AlFpBDIgDHFLKZn1HOJASK3o/QHtLZJ8VOg0
> 13WQGgQJwAsMQHfpq4FW2EaPSK0YT/kUvCZq4093DxuGeCWnxc6NsBFgfSt9bOCk
> gGPfcrRAosr+8QJvTZ1Q07OoBThto2gk2TolY7JUG6tnwKkJwu1djB82O6WHqfNK
> TWmzaRGus6CvqXKdY90mAZQg0cV48Q/sbBZPAmR3IQaYVww0m2uRyHnuPda2f3Y4
> mzwSyrv+dDMtsFX1gzNCfIS4VdRpbLTQjagB2vhTm2Ce4e+ktDP7oOqlXK+ZY/Wv
> ZiFYCYBrsFPMzS2x31giE+T5ZuXY+PQ8OdPUsyFXLcdi2BNJ82FmuYsyNqCyFQ5L
> CyW5aI5heOcCME/mJ0FJzHlGbudHre8jrWgZ+/cUmQy/w9zEq9eW63oT/Vsb5ZEi
> 1OTvSFZAwDbbDbQmshDQKUKTK3EtKpoN6o7NsjvPbzfSfy+j1+OUJ34zoSZ/hf20
> yF+ysF1wEeCkTMTn+4vhHmLyfQmM19VQiTXrLPdLwS/DT/Ytnoja2Uu4YXGHqQkr
> mLxvHS5UNnCb3QXRZJksE8wCy1z6Nl7d4zKSPDyZI2jtL/21YOc=
> =nLjE
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to