Based on the Borland application server, JAAS and the inherent security mechanism of the J2EE Web container are used, and with the help of the user authentication of the Oracle database, the authentication and authorization of users in Web applications are realized. The resources that users can access are controlled at the page level, and the security issues that need to be considered in the development stage are transferred to the deployment stage, realizing the complete separation of application logic and security logic. Practice shows that the use of JAAS can improve the development efficiency of the entire system, and the authentication and authorization provided by the Web container can be well combined with the database security domain. Keywords Authentication; Authorization; JAAS; J2EE Web container; Security In large and medium-sized Web applications, achieving system security is something that system architects must consider. The security of the system is mainly reflected in two parts: authentication and authorization. Authentication means to determine that a user is who he claims to be; authorization (Authorization) or access control means that the authenticated user can only access those resources that he is allowed to access. Different users have different access rights to different resources. How to authenticate and authorize many users is the key to building a system. In early Web applications, programmers wrote code to check permissions on each page to protect the page. If the permissions change, the application-level code needs to be modified. The maintainability and code reusability of the entire system are not high, and the development efficiency is low. However, by using the authentication and authorization mechanism provided by the Java Authentication and Authorization Service (JAAS) and the inherent security mechanism of the Web container, user authorization can be implemented during the deployment phase, and user authentication can be implemented with the help of other security domains (such as databases). 1 Authentication and authorization provided by JAAS JAAS is an authentication and authorization framework defined in the J2EE specification. The authentication mechanism it provides is pluggable, that is, the current application can add new authentication methods while keeping the existing authentication mechanism unchanged without changing the application-level code; the system administrator decides which authentication technologies to use and their authentication order in the configuration file. Therefore, it is very suitable for enterprises to use when they already have a set of authentication mechanisms. Under the JAAS framework, developers only need to interact with the login context (LoginContext) at the application layer. Under LoginContext is a group of dynamically configured login module (LoginModule) objects. LoginModule is an interface for calling a specific authentication mechanism. For a class that specifically implements the LoginModuel interface, it is an authentication method. When developing a system, you can use several LoginModule implementation classes included in J2EE1.4 (such as JndiLoginModule, Krb5LoginModule, NTLoginModule, UnixLogin Module) as needed, or write your own LoginModule, or use the relevant implementation provided by the application server. The JAAS framework uses a configuration file to specify the authentication mechanism to be used and encapsulates the authentication module. Developers do not need to write any code for how to call the authentication module. The system will take the corresponding authentication method according to the authentication mechanism defined in the configuration file. If the authentication is successful, a subject containing the authentication information will be returned, and this authentication information will be used in the authorization process.
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore