How does it work?
The net.sf.jguard.filters.AccessFilter class is the main integration between the web application and jGuard. Access control is done through the AccessFilter. The AccessFilter is a servlet filter (javax.servlet.Filter) and has the follow duties:
- Configure the access control of web application;
- Authenticate the users;
- Deny unauthorized access to a URL;
- Logoff the user (The user needs to login again);
- The user tries to access a protected URL. If the AccessFilter intercepts the request and verifies that the URL is a special URL, that it is not controlled (logonURI, authenticationFailedURI, accessDeniedURI), then go to the setp 2, else go to step 3;
- The request continues and user goes to the desired URL;
- The AccessFilter verifies if the user is authenticated. If the user is not authenticated then go to the step 4, otherwise go to step 8;
- The filter verifies if there the request contains the login and password data. If not, the jGuard uses GUEST/GUEST to authenticate as a guest. Now go to step 5;
- The filter tries to authenticate the user by the application's LoginModule(s). If authentication is sucessful go to step 6, else go to step 7;
- The authenticated Subject is stored in the session and the user redirected to indexURI page;
- The user is redirected to authenticationFailedURI because the authentication failed;
- The filter checks if the URL is logoffURI, meaning that the user wants to logoff. If so go to step 9, else go to step 10;
- The Subject is removed from the session and the session is invalidated. The user is redirected to the logoffURI;
- jGuard checks if the user has permission to access the URL, meaning, the user has one permission that implies the current permission associated to one user's principals. If the user has access, go to step 11, else, go to step 12;
- The user is redirected to the desired page;
- The user is redirected to the accessDeniedURI because has not access to the URL;
Version 1.16 last modified by Charles Gay on 26/09/2006 at 15:54
Comments: 0