隨筆-12  評論-0  文章-1  trackbacks-0
           
          JAAS generally has the following two steps:
          1, Authentication: define principals,  implement LoginModule and callback handler, associate designated principals with the subject object in the commit method of LoginModule implementation, configure the module implementation in a login configuration file, i.e
          Sample {
             sample.module.SampleLoginModule required debug=true;
          };

          lc = new LoginContext("Sample", new MyCallbackHandler());
          Subject s = lc.getSubject();
          Subject.doAs(s, new PrivilegedAction(){...}); // the authenticated subject s will be associated with the current access control context.

          2. Authorization: write policy file to grant principals access right to any critical resources. e.g.
          grant
                  Principal sample.principal.SamplePrincipal "testUser" {

             permission java.util.PropertyPermission "java.home", "read";
             permission java.util.PropertyPermission "user.home", "read";
             permission java.io.FilePermission "foo.txt", "read";
          };
          posted @ 2011-12-31 14:32 Sam Zheng 閱讀(134) | 評論 (0)編輯 收藏
          to decouple modules or sub systems: define interfaces and dependencies between modules
          posted @ 2011-11-22 12:24 Sam Zheng 閱讀(101) | 評論 (0)編輯 收藏
          僅列出標題
          共2頁: 上一頁 1 2 
          主站蜘蛛池模板: 尼勒克县| 武汉市| 洞头县| 台南市| 南靖县| 微山县| 那曲县| 东台市| 班戈县| 拉萨市| 九江市| 三江| 溆浦县| 拜城县| 邵东县| 包头市| 黔西县| 左云县| 松阳县| 宁国市| 通山县| 巫山县| 威信县| 保山市| 常宁市| 江孜县| 中西区| 鄂州市| 温州市| 云南省| 湖口县| 噶尔县| 安泽县| 腾冲县| 大埔区| 右玉县| 安远县| 长汀县| 潮安县| 中山市| 广东省|