Java EE Security API 1.0 特性不斷的擴展中
Java EE Security API (JSR 375) 不斷的在發展中,來自 Arjan Tijms 的文章 http://arjan-tijms.omnifaces.org/p/whats-new-in-java-ee-security-api-10.html 對此有更詳細的描述。
其中值得關注的新版本包含一個名為 Soteria 的參考實現。該名稱最初來自 Greek Mythology 安全和拯救女神 [Wikipedia]. 我們的 Soteria 代碼可通過這里訪問 (https://github.com/javaee-security-spec/soteria) ,同時也可以通過 推ter 關注 @Soteria_RI.
Soteria GitHub 倉庫包含一組示例演示了新的特性 https://github.com/ivargrimstad/security-samples.
如下面代碼所示,可以很直接的定義一個用于 MVC 1.0 應用的嵌入式的標識存儲:
@EmbeddedIdentityStoreDefinition({ @Credentials(callerName = "hem", password = "cheese", groups = {"foo"}), @Credentials(callerName = "haw", password = "cheeze", groups = {"foo", "bar"})} ) @DeclareRoles({"foo", "bar"}) @ApplicationPath("ui") public class ApplicationConfig extends Application { @Override public Set<Class<?>> getClasses() { Set<Class<?>> classes = new HashSet<>(); // add controllers return classes; }
via dzone
來自: http://www.oschina.net//news/70909/java-ee-security-api-moving-forward
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!