Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem with <auth-constraint>

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In HFSJ book errata I found this question fix:


First security constraint contains:.
234. <auth-constraint>
235. <role-name>student</role-name>
236. </auth-constraint>


And the second security constraint contains:
251. <auth-constraint/>

Answer D
D: If the second <auth-constraint> tag is removed, the constrained resource can be accessed by both roles.
Is wrong and answer F:
F: If the second <auth-constraint> tag is removed, the constrained resource can be accessed only by student users.
Is the correct answer.



Why D is wrong?
 
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has been asked in the forum before. I agree that the answer should be D and not F. I submitted an errata of this errata here but it seems no one saw it...
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Maciek Mike wrote:Hi,
D: If the second <auth-constraint> tag is removed, the constrained resource can be accessed by both roles.
Is wrong and answer F:


You have only one role (student). With the second auth-constraint tag nobody (to be precise, no role) has access to the constrained HTTP method. But if you remove the empty auth-constraint tag the role student has access again.

EDIT: I just read the post from Ankit. It's right, if you remove the auth-constraints altogether everybody has access. Still D is wrong, because I don't see a second role in the code (Or so ). Must be a trap for the poor coders


cheers
Bob
    Bookmark Topic Watch Topic
  • New Topic