Java
  Home arrow Java arrow JAAS, Securing J2EE Applications: Securing...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

JAAS, Securing J2EE Applications: Securing Web Components
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 23
    2005-08-17

    Table of Contents:
  • JAAS, Securing J2EE Applications: Securing Web Components
  • JAAS: What is it?
  • Subject, Principal and Credentials
  • Implementing the JAAS Security Module
  • 2. Write the CallBackHandler
  • 4. Configure the JAAS policy file
  • Using the JAAS Module to Secure the Web Component

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    JAAS, Securing J2EE Applications: Securing Web Components


    (Page 1 of 7 )

    Web applications must be developed with security in mind right from the start. Developers should plan for securing a web application with both the web server and the application server in mind. Securing a J2EE application can seem very complicated, however. This article, the first of two parts, explains how to secure J2EE web components.

    “Prevention is better than cure”

    This age old adage holds true even today, especially in the case of web applications. Site defacement is only one aspect of website attacks. It does not augur well if the security of an application is first considered after an attack. Applications must be developed with their security aspects well defined in advance.

    Until a few years ago, security meant securing the web server. But with the advent of server-side programming, security cannot be limited to the resources within the web server, as most of the processing and servicing of the request is done by code executing within the application server. In the case of J2EE, securing a web application can be perplexing; a J2EE application can consist of one or more different components, each providing service to a different layer. So what is the solution? The solution comes in two different packages:

    • Declarative Security: If one is adopting this approach, then all the security constraints are specified within the web.xml file of the application. The container reads these constraints and performs the access control for that particular application.

    • Programmatic Security: Under this model, the responsibility for securing the web application belongs solely to the programmer. The logic for authenticatomg and authorizing the user is embedded within the application. It can exist as a service at the boundary of the application or within each module.

    Realms based security comes under the former, while Java Authentication and Authorization Services (JAAS) based security comes under the latter. The next obvious question that arises is, which is superior? The answer, often repeated, is that the context determines usage. If codeless security is the context, then declarative security is better. If fine-grained control is the requirement, then programmatic security is the best choice. 

    Resuming the context of J2EE components, they are divided into Web Components and Business Components. Servlets and JSPs are Web Components whereas Enterprise Java Beans (EJBs) are Business Components. The method for securing Web Components is different from that for securing Business Components. In this tutorial, I will be discussing how to securing Web Components using JAAS. Before implementation is discussed, it is better to get acquainted with the JAAS, its overview and its vocabulary.

    More Java Articles
    More By A.P.Rajshekhar


       · HiThank you for reading. Hope it was helpful. Please comment.A.P.Rajshekhar
       · Very well structured and helpful for a newbie like me. The "almost" is because I...
       · found it very helpful, it only lacks references to specific server aplication...
       · Thhanks for your comments. Since here the context is Web Applicatin, so there is no...
       · Hi thanks for that article, it helped clear a lot of confusion i was having about...
       · Hi liked the explanation of JAASLoginFilter. But what i am not able to understand...
       · put the rigth code or dont put anything, that snippets of code was writed with your...
     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT