隨筆-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 on 2011-12-31 14:32 Sam Zheng 閱讀(134) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 崇信县| 马山县| 宜宾市| 遂宁市| 龙里县| 三门县| 巧家县| 博罗县| 五家渠市| 枝江市| 新宾| 凤台县| 龙口市| 沾化县| 万载县| 名山县| 织金县| 龙川县| 吉安市| 安远县| 舒城县| 车险| 石渠县| 泗水县| 寻甸| 仙桃市| 东港市| 张掖市| 济宁市| 富民县| 新沂市| 渝北区| 吐鲁番市| 确山县| 九龙城区| 永新县| 济南市| 宜城市| 蓝山县| 荥经县| 南丹县|