Lines 74-79
Link Here
|
74 |
import javax.security.auth.login.FailedLoginException; |
74 |
import javax.security.auth.login.FailedLoginException; |
75 |
import javax.security.auth.login.LoginContext; |
75 |
import javax.security.auth.login.LoginContext; |
76 |
import javax.security.auth.login.LoginException; |
76 |
import javax.security.auth.login.LoginException; |
|
|
77 |
import javax.security.auth.callback.CallbackHandler; |
77 |
import org.apache.catalina.Lifecycle; |
78 |
import org.apache.catalina.Lifecycle; |
78 |
import org.apache.catalina.LifecycleException; |
79 |
import org.apache.catalina.LifecycleException; |
79 |
import org.apache.catalina.util.StringManager; |
80 |
import org.apache.catalina.util.StringManager; |
Lines 283-290
Link Here
|
283 |
LoginContext loginContext = null; |
284 |
LoginContext loginContext = null; |
284 |
try { |
285 |
try { |
285 |
loginContext = new LoginContext |
286 |
loginContext = new LoginContext |
286 |
(appName, new JAASCallbackHandler(this, username, |
287 |
(appName, createCallbackHandler(username,credentials)); |
287 |
credentials)); |
|
|
288 |
} catch (LoginException e) { |
288 |
} catch (LoginException e) { |
289 |
log(sm.getString("jaasRealm.loginException", username), e); |
289 |
log(sm.getString("jaasRealm.loginException", username), e); |
290 |
return (null); |
290 |
return (null); |
Lines 402-407
Link Here
|
402 |
|
402 |
|
403 |
} |
403 |
} |
404 |
|
404 |
|
|
|
405 |
/** |
406 |
* Constructs a CallbackHandler to be used with the JAAS LoginContext |
407 |
* to handle the information needed by the configured LoginModule. |
408 |
* |
409 |
* @param username The user's login name. |
410 |
* @param credentials The password supplied by the user. |
411 |
* @return A CallbackHandler for the configured LoginModule. |
412 |
*/ |
413 |
protected CallbackHandler createCallbackHandler(String username, |
414 |
String credentials) { |
415 |
return new JAASCallbackHandler(this, username, credentials); |
416 |
} |
405 |
|
417 |
|
406 |
// ------------------------------------------------------ Lifecycle Methods |
418 |
// ------------------------------------------------------ Lifecycle Methods |
407 |
|
419 |
|