Using JAAS (Java Authentication and Authorization Service) on Android

允我心安 提交于 2019-12-01 11:07:45

问题


Is it possible to use JAAS within an android app?
In the android API most of the classes of the javax.security.auth package are saying

Legacy security code; do not use.

But is there any replacement for user-centric JAAS on android? Or might it work if I manually deploy the jaas.jar?


回答1:


JAAS doesn't really apply to Android. JAAS provides user-centric security to Java-based applications (who is the identity - usually a "user" such as an LDAP user id - that is "running" the application and are they allowed to do what they are trying to). In Android, user IDs are used differently in that each application runs with a different user ID in order to separate the applications from each other. As there are very different concepts of identity between a JAAS-enabled Java application and an Android application, the JAAS model doesn't reconcile well with the Android model, hence the warnings in the docs.

The quasi-equivalent in the Android world is the permissions model, which is explained in great detail in this book: http://shop.oreilly.com/product/0636920022596.do.



来源:https://stackoverflow.com/questions/8636599/using-jaas-java-authentication-and-authorization-service-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!