Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Basic Authentication Does Not Work Properly  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Inordere to implement BASIC authentication having following configurationPutting this in tomcat user.xml

<role rolename="Admin"/>
<role rolename="Member"/>
<role rolename="Guest"/>

<user username="admin1" password="admin1" roles="Admin,Member,Guest"/>
<user username="knroy" password="knroy" roles="Member"/>
<user username="guest1" password="guest1" roles="Guest"/>

putting this in myproject1--->web.xml

<security-role>
<role-name>Admin</role-name>
</security-role>
<security-role>
<role-name>Member</role-name>
</security-role>
<security-role>
<role-name>Guest</role-name>
</security-role>


<security-constraint>
<web-resource-collection>
<web-resource-name>Testing</web-resource-name>
<url-pattern>/validate/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Admin</role-name>
<role-name>Member</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>


and restart tomcat 6 ----->run Project---> asking login prompt---->username: admin1 password:admin1--->HTTP 401 error
[ Under Windows XP with running in localhost:8080 ]

Why it is not working despite follwing all the steps as mentioned above
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anytime you have a client-server application that gives you problems, supplying just the client-side error message rarely helps you get an answer. Have you looked at the server's log to see what error is reported? If you cannot make out what the error means, post the server-side error message on the forum; you might get a solution or a pointer to the solution.

Arshad Noor
StrongAuth, Inc.
 
Kashinath Roy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please find error message

HTTP Status 401 -

--------------------------------------------------------------------------------

type Status report

message

description This request requires HTTP authentication ().


--------------------------------------------------------------------------------

Apache Tomcat/6.0.35






 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!