• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to implementing good security in Servlet?

 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends,,

how to implementing good security, example for authentication in Servlet?..
Assume that i have application which has Create, Read, Update, and Delete method..
Admin could accessed all methods..
but Employee just could read the data..
How to good implementing that requirements?..
Do i have to provides 2 Servlet with 2 forms?..
or could i have one servlet with one form?..

i interested Spring Security which has Method security implements..
could i do like Spring Security in Servlet?..
i uses JBoss 5.1 + JSP + Servlet + EJB3..

please give me any suggestion..
Thanks in advance ..
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You can also use ACEGI security framework for spring framework Its available at

http://www.acegisecurity.org/
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The easiest would be to use the authentication/authorization framework that's built into the Servlet API. It implements a username/password/role scheme that makes authentication information available through the HttpServletRequest's getRemoteUser and isUserInRole methods.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies..


How to set username/password/role scheme in HttpServletRequest?..
assume that i have login application..
the users who wants to login to my application must filled the Login (username, and password)..
and the users who can login to my application is admin and employers?..
how to set that user's role (either admin/employee) to HttpServletRequest?..

Would you like to give me an example?..

Thanks in advance..
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some of the details are specific to your servlet container, while some others are generic for all web apps. See http://faq.javaranch.com/java/ServletsFaq#security for further information.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Ulf Dittmer

Thanks sir..

i uses JBoss 5.0..
Okay.. Firstly i'll try it in Tomcat6.. then i'll implement it in JBoss..
Hope it will run well..
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic