?? authenticationdemo1.java
字號:
// ==================== Program Discription ==========================
// 程序名稱:示例20-1 : AuthenticationDemo1.java
// 程序目的:使用JAAS進行認證
// ==============================================================
public class AuthenticationDemo1
{
public static void main(String[] args) {
LoginContext lc = new LoginContext("Example");
try {
lc.login();
} catch (LoginException) {
// Authentication failed.
}
//If Authentication successed, we can use the returned Subject.
Subject sub = lc.getSubject();
Subject.doAs(sub, new MyPrivilegedAction());
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -