簡體   English   中英

在jaas中我們可以使用javax.security.auth.login.Configuration類的對象作為使用.config文件的LoginModule配置的替代方法

[英]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:

[...]

  1. 組態

    如果構造函數具有Configuration輸入參數且調用者指定非空配置,則LoginContext使用調用者指定的Configuration。

[...]

public LoginContext(String name,
                    Subject subject,
                    CallbackHandler callbackHandler,
                    Configuration config)
             throws LoginException

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM