Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Does Security annotations work only with EJB

 
Ranch Hand
Posts: 391
1
MySQL Database PHP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was doing enthuware exams and I get across this

" The root resource class is not an EJB, therefore role-based security does not work "

So it means annotations like @RolesAllowed, @DenyAll, @PermitAll only work when its used with EJB.

So simply saying below on a jersey root resource class will not work , it must be annotated with either @Stateless or @Singleton

@Path("somepath")
@RolesAllowed("student")

Need some clarity
 
Creator of Enthuware JWS+ V6
Posts: 3341
303
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

So it means annotations like @RolesAllowed, @DenyAll, @PermitAll only work when its used with EJB.


Correct.
 
Greenhorn
Posts: 13
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Frits Walraven wrote:

So it means annotations like @RolesAllowed, @DenyAll, @PermitAll only work when its used with EJB.  


Correct.



Why?  I've been trying to find a reason but unsuccessfully.  Could you kindly expatiate?

Thank you,
Victor.
 
Victor Skvorzkoff
Greenhorn
Posts: 13
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Victor Skvorzkoff wrote:

Frits Walraven wrote:

So it means annotations like @RolesAllowed, @DenyAll, @PermitAll only work when its used with EJB.  


Correct.



Why?  I've been trying to find a reason but unsuccessfully.  Could you kindly expatiate?

Thank you,
Victor.



I finally found some explanation here: https://coderanch.com/t/644645/certification/role-based-security-jax-rs    

 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3341
303
Android Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answering your own question (and sharing it here) deserves a Cow!
 
Onion rings are vegetable donuts. Taste this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic