flex.messaging.security
Interface TomcatLogin


public interface TomcatLogin

Interface to code in the Tomcat valve. Why is this needed? Because Tomcat has a classloader system where code in a valve does not appear in the classloader that is used for servlets. There is a commons area that both valves and servlets share, however, which is where this interface needs to be placed. JAR NOTE: this class is not in flex-messaging.jar but rather flex-tomcat-common.jar.


Method Summary
 boolean authorize(Principal principal, List roles)
          The gateway calls this method to perform programmatic authorization.
 Principal login(String username, String password, javax.servlet.http.HttpServletRequest request)
          Attempt to login user with the specified credentials.
 boolean logout(javax.servlet.http.HttpServletRequest request)
          Logs out the user associated with the passed-in request
 

Method Detail

login

Principal login(String username,
                String password,
                javax.servlet.http.HttpServletRequest request)
Attempt to login user with the specified credentials. Return a generated Principal object if login were successful

Parameters:
username - username
password - credentials
request - request via which this login attempt was made
Returns:
Principal generated for user if login were successful

authorize

boolean authorize(Principal principal,
                  List roles)
The gateway calls this method to perform programmatic authorization.

A typical implementation would simply iterate over the supplied roles and check that atleast one of the roles returned true from a call to HttpServletRequest.isUserInRole(String role).

Parameters:
principal - The principal being checked for authorization
roles - A List of role names to check, all members should be strings
Returns:
true if the principal is authorized given the list of roles

logout

boolean logout(javax.servlet.http.HttpServletRequest request)
Logs out the user associated with the passed-in request

Parameters:
request - whose associated user is to be loged-out
Returns:
true if logout were successful


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/security/TomcatLogin.html