![](/img/trans.png)
[英]Jaas/Kerberos : specify LoginModule elsewhere than in the configuration file
[英]In jaas can we use an object of javax.security.auth.login.Configuration class as an alternative to LoginModule configuration using .config files
在執行JAAS身份驗證時,我不想使用.config文件進行LoginModule查找/配置。 我的問題是; 有沒有辦法在不使用.config文件的情況下執行此操作? 或者我們可以為此目的使用javax.security.auth.login.Configuration對象,因為在閱讀Oracle javadoc后我不清楚http://docs.oracle.com/javase/8/docs/api/javax/security/auth /login/Configuration.html
在LoginContext的構造函數中傳遞配置 。
請參閱LoginContext上的 JavaDoc:
[...]
組態
如果構造函數具有Configuration輸入參數且調用者指定非空配置,則LoginContext使用調用者指定的Configuration。
[...]
public LoginContext(String name,
Subject subject,
CallbackHandler callbackHandler,
Configuration config)
throws LoginException
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.