Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

security issue

 
srinivas.b
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

i am unable to login even though i am valid user.

tomcat-users.xml

<role rolename="systemAdmin"/>
<role rolename="taskAdmin"/>
<role rolename="normalUser"/>
<user username="systemAdmin" password="tomcat" roles="systemAdmin,taskAdmin,normalUser"/>
<user username="taskadmin" password="dnrc" roles="taskAdmin,normalUser"/>
<user username="user" password="" roles="normalUser"/>

and in web.xml i Have mentioned in the below way

<security-role>
<role-name>systemAdmin</role-name>
</security-role>
<security-role>
<role-name>taskAdmin</role-name>
</security-role>
<security-role>
<role-name>normalUser</role-name>
</security-role>

<!-- To enable security -->
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>UpdateRecipes</web-resource-name>

<url-pattern>/Authorization</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>

<auth-constraint>
<role-name>systemAdmin</role-name>
<role-name>taskAdmin</role-name>
<role-name>normalUser</role-name>
</auth-constraint>
</security-constraint>

when i hit /Authorization iam getting a POP to enter username and password
but i am unable to login with any rolenames systemAdmin,taskAdmin,normalUser.

tomcat version-5.0


Can any one explain me why i am geeting error?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am unable to login with any rolenames systemAdmin,taskAdmin,normalUser.

What error do you get ?
 
srinivas.b
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP Status 401 -

type Status report

message

description This request requires HTTP authentication ().
 
srinivas.b
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOPs

I am unable to login to POPup message (Authentication required)
if i cancled the POPup iam getting the below error message

HTTP Status 401 -

type Status report

message

description This request requires HTTP authentication ().
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What username/password do you enter ?
 
srinivas.b
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had tried with

username password
systemAdmin-tomcat
taskadmin-dnrc
user-

the problem is i need to added the tomcat-users.xml in server as iam trying to run on eclipse.I have added now

but know its giving the error

HTTP Status 403 - Access to the requested resource has been denied
 
srinivas.b
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It working fine for me know...

i have inccluded the below in web.xml

<resource-env-ref>
<resource-env-ref-name>users</resource-env-ref-name>
<resource-env-ref-type>
org.apache.catalina.UserDatabase
</resource-env-ref-type>
</resource-env-ref>
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is i need to added the tomcat-users.xml in server as iam trying to run on eclipse.

That's why some recommend not to use IDEs for the exam, unless you know what you do
 
srinivas.b
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the use of the below

<resource-env-ref>
<resource-env-ref-name>users</resource-env-ref-name>
<resource-env-ref-type>
org.apache.catalina.UserDatabase
</resource-env-ref-type>
</resource-env-ref>

can any one explain me what is the use of the above lines?

I didn't find the above thing to inculde in HFSJ book .
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't find the above thing to inculde in HFSJ book .

Because you don't need the above thing. I tried your example, settings the users and roles in tomcat-users.xml, and setting the security constraints in web.xml. It works fine. Your problem comes either from your Tomcat installation, or your Eclipse project. This issue out of scope of the SCWCD forum. I will probably move it to a more relevant forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic