Chapter 15. Authentication and Authorization

So far, we’ve examined security mainly from the perspective of how it protects the end user from the outside world. The default sandbox protects end users from writers of malicious Java programs; digital signatures protect the integrity of end user data while encryption protects the confidentiality of end user data.

But how do we protect the rest of the world from end users? That’s the topic of this chapter, which focuses on the Java Authentication and Authorization Service ( JAAS). JAAS provides a framework through which developers can require users who execute their code to have explicit permission to perform certain operations.

JAAS provides a set of classes that authenticate a user. This typically means that a JAAS-enabled application requires a user to log into it, much like the user logs into his computer (in fact, JAAS often uses the operating system to authenticate the user directly). JAAS also provides a set of classes that authorize users to perform certain operations; this authorization is very similar to the permissions-based authorization that the default sandbox grants to code loaded from particular locations or signed by particular entities.

Like the default sandbox, permissions granted to particular users by JAAS are administered by a system administrator; the system administrator also sets up the default parameters that JAAS uses. However, applications must be modified in order to use JAAS; by default, Java applications ...

Get Java Security, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.