• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Authorization problem (!!!NOT SOLVED!!!)  RSS feed

 
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have configured some roles in my web.xml file like below;



And I have also adjustes my server's user configuration xml( Tomcat )

tomcat-users.xml extract




However when I tried to call an URL like below;

http://localhost:8080/ApacheProject/securezone/apage.html

First I get a basic login screen and I wrote my password but the server does not accept my password and after some try It gives a HTTP Status 401 - This request requires HTTP authentication ().

page to me.

What am I doing wrong here? Everything seems okay to me!!
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am waiting your valuable responses... Because I am very confused about this subject!
[ December 30, 2008: Message edited by: Anut Walidera ]
 
Greenhorn
Posts: 7
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anut

It�s works.
You have wrote that browser prompt the login/password and you entered these information. But you have gotten 401 error after some attempts. So, if the configuration was wrong, probably the app didn�t start, and you cound see an error at tomcat�s log.
This error message, 401, represents a wrong user and/or password entered by user.(See at http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html, for http messages)
To see the headers informations use LiveHttpHeaders (http://livehttpheaders.mozdev.org/) for Mozila Firefox.

Regards
Phillipe Lemos
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I have tried many times. My Username and password is correct I am really sure about this, thank you but I need another solution for this question...
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

'Member' is not in your security role.

Kathir
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, still no working by adding Member role to my web.xml file... ?
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<url-pattern>/securezone/*</url-pattern>



change above line to

<url-pattern>/*</url-pattern>

 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It asks everytime an username and password however
nothing is changed !!
Another solution is needed!!!
[ December 31, 2008: Message edited by: Anut Walidera ]
 
sridhar row
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think instead of clicking on the submit button, you are clicking on the cancel button.
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Warnakulasuriya Patabendige Ushanth:
I think instead of clicking on the submit button, you are clicking on the cancel button.



Are you joking ? Of course I am not... Also there is not submit button
there are OK and Cancel
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you configure tomcat to use the tomcat-users.xml file as one of the Resource elements? chances are it doesn't have a realm configured just yet.
[ January 01, 2009: Message edited by: cesar valencia ]
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I configure it ?
It is normally stayed at
apache-tomcat-6.0.18\conf\tomcat-users.xml

And I did not make any other configuration ? And it is content ;

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="Guest" />
<role rolename="Member" />
<user username="anthony" password="12345678" roles="Guest,Member" />
</tomcat-users>
[ January 02, 2009: Message edited by: Anut Walidera ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!