JaasAuthenticator

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(renamed tag to directive)
Line 12: Line 12:
 
     <init>
 
     <init>
 
       <login-module>com.sun.security.auth.module.Krb5LoginModule</login-module>
 
       <login-module>com.sun.security.auth.module.Krb5LoginModule</login-module>
       <init-param debug="true"/>
+
       <init-param>
     </init>
+
        <debug>true</debug>
 +
        <foo>bar</foo>
 +
     </init-param>
 
   </authenticator>
 
   </authenticator>
 
   
 
   

Revision as of 19:19, 3 April 2006


Resin provides a JaasAuthenticator for the usage of any JAAS LoginModule. A number of JAAS LoginModule implementations are included with the JDK, and it is fairly easy to create your own,

Contents

Example

resin-web.xml

<web-app xmlns="http://caucho.com/ns/resin">

 <authenticator type="com.caucho.server.security.JaasAuthenticator">
   <init>
     <login-module>com.sun.security.auth.module.Krb5LoginModule</login-module>
     <init-param>
        <debug>true</debug>
        <foo>bar</foo>
   </init-param>
 </authenticator>

</web-app>

<init-param> directives

<init-param> directives are used to configure the properties of the LoginModule. Existing LoginModules provide documentation of the init-param that are accepted. Custom LoginModule implementations retrieve the init-param values in the initialize method:

LoginModule implementation retrieves init-param

 public void initialize(Subject subject, 
                        CallbackHandler callbackHandler,
                        Map<String,?> sharedState,
                        Map<String,?> options) 
 {
 
   // initialize any configured options
   _isDebug = "true".equalsIgnoreCase((String) options.get("debug"));
   ...
 }
Personal tools