[jboss-cvs] JBossAS SVN: r64381 - projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/auth/container/modules.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 31 14:08:32 EDT 2007
Author: anil.saldhana at jboss.com
Date: 2007-07-31 14:08:32 -0400 (Tue, 31 Jul 2007)
New Revision: 64381
Modified:
projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/auth/container/modules/AbstractServerAuthModule.java
Log:
update validate method signature to contain subject and do not check for supportedTypes as they are checked by the serverauthcontext
Modified: projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/auth/container/modules/AbstractServerAuthModule.java
===================================================================
--- projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/auth/container/modules/AbstractServerAuthModule.java 2007-07-31 18:07:02 UTC (rev 64380)
+++ projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/auth/container/modules/AbstractServerAuthModule.java 2007-07-31 18:08:32 UTC (rev 64381)
@@ -58,6 +58,10 @@
protected MessagePolicy responsePolicy = null;
+ protected Object requestInfo = null;
+
+ protected Object responseInfo = null;
+
protected Map options = null;
protected ArrayList<Class> supportedTypes = new ArrayList<Class>();
@@ -91,31 +95,30 @@
Subject serviceSubject)
throws AuthException
{
- //Check whether we are in the supported types
- if(supportedTypes.contains(messageInfo.getRequestMessage().getClass()))
+ this.requestInfo = messageInfo.getRequestMessage();
+ this.responseInfo = messageInfo.getResponseMessage();
+
+ String loginModuleName = (String) options.get("login-module-delegate");
+ if(loginModuleName != null)
{
- String loginModuleName = (String) options.get("login-module-delegate");
- if(loginModuleName != null)
+ ClassLoader tcl = SecurityActions.getContextClassloader();
+ try
{
- ClassLoader tcl = SecurityActions.getContextClassloader();
- try
- {
- Class clazz = tcl.loadClass(loginModuleName);
- LoginModule lm = (LoginModule) clazz.newInstance();
- lm.initialize(clientSubject, callbackHandler, new HashMap(), options);
- lm.login();
- lm.commit();
- }
- catch (Exception e)
- {
- throw new AuthException(e.getLocalizedMessage());
- }
- }
- else
+ Class clazz = tcl.loadClass(loginModuleName);
+ LoginModule lm = (LoginModule) clazz.newInstance();
+ lm.initialize(clientSubject, callbackHandler, new HashMap(), options);
+ lm.login();
+ lm.commit();
+ }
+ catch (Exception e)
{
- return validate() ? AuthStatus.SUCCESS : AuthStatus.FAILURE;
+ throw new AuthException(e.getLocalizedMessage());
}
- }
+ }
+ else
+ {
+ return validate(clientSubject) ? AuthStatus.SUCCESS : AuthStatus.FAILURE;
+ }
return AuthStatus.SUCCESS;
}
@@ -147,5 +150,5 @@
* @return
* @throws AuthException
*/
- protected abstract boolean validate() throws AuthException;
+ protected abstract boolean validate(Subject clientSubject) throws AuthException;
}
More information about the jboss-cvs-commits
mailing list