<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Java_Authentication_and_Authorization_Service</id>
	<title>Java Authentication and Authorization Service - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Java_Authentication_and_Authorization_Service"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Java_Authentication_and_Authorization_Service&amp;action=history"/>
	<updated>2026-04-23T07:43:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=Java_Authentication_and_Authorization_Service&amp;diff=2463874&amp;oldid=prev</id>
		<title>imported&gt;Dujo: Move external link to reference</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Java_Authentication_and_Authorization_Service&amp;diff=2463874&amp;oldid=prev"/>
		<updated>2025-08-14T21:50:43Z</updated>

		<summary type="html">&lt;p&gt;Move external link to reference&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Java implementation of Pluggable Authentication Module}}&lt;br /&gt;
{{Refimprove|date=November 2024}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Java Authentication and Authorization Service&amp;#039;&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;&amp;#039;JAAS&amp;#039;&amp;#039;&amp;#039;, pronounced &amp;quot;Jazz&amp;quot;,&amp;lt;ref name=&amp;quot;guide&amp;quot;&amp;gt;{{Cite book |title = Java and internet security |url = https://books.google.com/books?id=JY7c3AIIXqMC |author1= Theodore J. Shrader |author2= Bruce A. Rich |author3= Anthony J. Nadalin |year = 2000|page = 152| publisher=iUniverse |isbn = 9780595135004}}&amp;lt;/ref&amp;gt; is the [[Java (programming language)|Java]] implementation of the standard [[Pluggable Authentication Module]] (PAM) [[information security]] framework.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
|url= http://download.oracle.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html&lt;br /&gt;
|title= Java Authentication and Authorization Service (JAAS) Reference Guide&lt;br /&gt;
|work= oracle.com&lt;br /&gt;
|publisher= [[Oracle Corporation]]&lt;br /&gt;
|access-date= 22 May 2012&lt;br /&gt;
|archive-url= https://web.archive.org/web/20120606055808/http://docs.oracle.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html&lt;br /&gt;
|archive-date= 6 June 2012&lt;br /&gt;
|url-status= dead&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
JAAS was introduced as an extension library to the [[Java Platform, Standard Edition]] 1.3 and was integrated in version 1.4.&amp;lt;ref name=&amp;quot;guide&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JAAS has as its main goal the [[separation of concerns]] of user authentication so that they may be managed independently. While the former [[authentication]] mechanism contained information about where the code originated from and who signed that code, JAAS adds a marker about who runs the code. By extending the verification vectors JAAS extends the security architecture for Java applications that require authentication and [[authorization]] modules.&lt;br /&gt;
&lt;br /&gt;
== Administration ==&lt;br /&gt;
For the [[system administrator]], JAAS consists of two kinds of [[configuration file]]:&lt;br /&gt;
*&amp;lt;code&amp;gt;*.login.conf&amp;lt;/code&amp;gt;: specifies how to plug vendor-supplied [[login]] modules into particular applications&lt;br /&gt;
*&amp;lt;code&amp;gt;*.policy&amp;lt;/code&amp;gt;: specifies which identities (users or programs) are granted which permissions&lt;br /&gt;
&lt;br /&gt;
For example, an application may have this {{mono|login.conf}} file indicating how different authentication mechanisms are to be run to authenticate the user:&lt;br /&gt;
&lt;br /&gt;
    PetShopApplication {&lt;br /&gt;
       com.sun.security.auth.module.LdapLoginModule sufficient;&lt;br /&gt;
       com.foo.SmartcardLoginModule                 requisite;&lt;br /&gt;
       com.sun.security.auth.module.UnixLoginModule required debug=true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== Application interface ==&lt;br /&gt;
&lt;br /&gt;
For the application developer, JAAS is a standard library that provides:&lt;br /&gt;
* a representation of identity (&amp;#039;&amp;#039;[[Principal (computer security)|Principal]]&amp;#039;&amp;#039;) and a set of credentials (&amp;#039;&amp;#039;[[Subject (access control)#Computer security|Subject]]&amp;#039;&amp;#039;)&lt;br /&gt;
* a [[login]] service that will invoke your application [[Callback (computer programming)|callbacks]] to ask the user things like username and [[password]]. It returns a new &amp;#039;&amp;#039;Subject&amp;#039;&amp;#039;&lt;br /&gt;
* a service that tests if a Subject was granted a permission by an administrator.&lt;br /&gt;
&lt;br /&gt;
== Security system integration ==&lt;br /&gt;
&lt;br /&gt;
For the security system integrator, JAAS provides interfaces:&lt;br /&gt;
* to provide your identity namespace to applications&lt;br /&gt;
* to attach credentials to threads (&amp;#039;&amp;#039;Subject&amp;#039;&amp;#039;)&lt;br /&gt;
* for developing [[login]] modules. Your module invokes [[Callback (computer programming)|callbacks]] to query the user, checks their response and generates a &amp;#039;&amp;#039;Subject&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Login Modules ==&lt;br /&gt;
Login modules are primarily concerned with authentication rather than authorization and form a widely used component of JAAS.&amp;lt;ref&amp;gt;{{Cite journal|url=https://javaranch.com/journal/2008/04/Journal200804.jsp#a6|title=JAAS Tutorial|first1=Rahul|last1=Bhattacharjee|date=April 2008|volume=7|issue=1|website=javaranch.com}}&amp;lt;/ref&amp;gt;  A login module is required to implement the &amp;lt;code&amp;gt;javax.security.auth.spi.LoginModule&amp;lt;/code&amp;gt; interface, which specifies the following methods:&lt;br /&gt;
&lt;br /&gt;
Note: A &amp;lt;code&amp;gt;Subject&amp;lt;/code&amp;gt; is the user that is attempting to log in.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;initialize:&amp;#039;&amp;#039;&amp;#039;  Code to initialize the login module, usually by storing the parameters passed into appropriate fields of the &amp;lt;code&amp;gt;Class&amp;lt;/code&amp;gt;.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;login:&amp;#039;&amp;#039;&amp;#039;  Actually check the credentials provided via an &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt; that implements the &amp;lt;code&amp;gt;javax.security.auth.Callback&amp;lt;/code&amp;gt; interface (e.g. check against a database).  This method could prompt the user for their login and password or it could use details previously obtained.  It is important to note here that, if invalid credentials are supplied then a &amp;lt;code&amp;gt;javax.security.auth.login.FailedLoginException&amp;lt;/code&amp;gt; should be thrown (rather than returning false, which indicates that this login module should be ignored, which potentially allows authentication to succeed).&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;commit:&amp;#039;&amp;#039;&amp;#039;  The identity of the subject has been verified, so code in this method sets up the &amp;lt;code&amp;gt;Principal&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Groups&amp;lt;/code&amp;gt; (roles) for the successfully authenticated subject.  This method has to be written carefully in enterprise applications as Java EE application servers often expect the relationships between the &amp;lt;code&amp;gt;Principal&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Group&amp;lt;/code&amp;gt; objects to be set up in a certain way.  This method should throw a &amp;lt;code&amp;gt;javax.security.auth.login.FailedLoginException&amp;lt;/code&amp;gt; if authentication fails (e.g. a user has specified an incorrect login or password).&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;abort:&amp;#039;&amp;#039;&amp;#039;  Called if the authentication process itself fails.  If this method returns false, then this Login Module is ignored.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;logout:&amp;#039;&amp;#039;&amp;#039;  Code that should be executed upon logout (e.g. could remove the &amp;lt;code&amp;gt;Principal&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;Subject&amp;lt;/code&amp;gt; or could invalidate a web session).&lt;br /&gt;
&lt;br /&gt;
Login modules can provide single sign on (SSO) via a particular SSO protocol/framework (e.g. [[SAML]], [[OpenID]], and [[SPNEGO]]), can check for the presence of hardware security tokens (e.g. USB token), etc.  In an n-tier application, &amp;lt;code&amp;gt;LoginModules&amp;lt;/code&amp;gt; can be present on both the client side and server side.&lt;br /&gt;
&lt;br /&gt;
=== LoginModule (&amp;lt;code&amp;gt;javax.security.auth.spi.LoginModule&amp;lt;/code&amp;gt;) ===&lt;br /&gt;
Login modules are written by implementing this interface; they contain the actual code for authentication. It can use various mechanisms to authenticate user credentials. The code could retrieve a password from a database and compare it to the password supplied to the module.&lt;br /&gt;
&lt;br /&gt;
=== LoginContext (&amp;lt;code&amp;gt;javax.security.auth.login.LoginContext&amp;lt;/code&amp;gt;) ===&lt;br /&gt;
The login context is the core of the JAAS framework which kicks off the authentication process by creating a Subject. As the authentication process proceeds, the subject is populated with various principals and credentials for further processing.&lt;br /&gt;
&lt;br /&gt;
=== Subject (&amp;lt;code&amp;gt;javax.security.auth.Subject&amp;lt;/code&amp;gt;) ===&lt;br /&gt;
A subject represents a single user, entity or system –in other words, a client– requesting authentication.&lt;br /&gt;
&lt;br /&gt;
=== Principal (&amp;lt;code&amp;gt;java.security.Principal&amp;lt;/code&amp;gt;) ===&lt;br /&gt;
A principal represents the face of a subject. It encapsulates features or properties of a subject. A subject can contain multiple principals.&lt;br /&gt;
&lt;br /&gt;
=== Credentials ===&lt;br /&gt;
Credentials are nothing but pieces of information regarding the subject in consideration. They might be account numbers, passwords, certificates etc. As the credential represents some important information, the further interfaces might be useful for creating a proper and secure credential – &amp;lt;code&amp;gt;javax.security.auth.Destroyable&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;javax.security.auth.Refreshable&amp;lt;/code&amp;gt;. Suppose that after the successful authentication of the user you populate the subject with a secret ID (in the form of a credential) with which the subject can execute some critical services, but the credential should be removed after a specific time. In that case, one might want to implement the &amp;lt;code&amp;gt;Destroyable&amp;lt;/code&amp;gt; interface. &amp;lt;code&amp;gt;Refreshable&amp;lt;/code&amp;gt; might be useful if a credential has only a limited timespan in which it is valid.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Apache Shiro]]&lt;br /&gt;
* [[Keystore]]&lt;br /&gt;
* [http://oaccframework.org OACC]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://jguard.xwiki.com/ jGuard : open source project which can secure standalone or web applications based on JAAS] {{Webarchive|url=https://web.archive.org/web/20081202041403/http://jguard.xwiki.com/ |date=2008-12-02 }}&lt;br /&gt;
* {{cite web |last1=Musser |first1=John |last2=Feuer |first2=Paul |date=2002-09-23 |df=mdy |url=https://www.infoworld.com/article/2074873/all-that-jaas.html |title=All that JAAS |work=[[JavaWorld]] |access-date=2020-07-20}}&lt;br /&gt;
* [https://spnego.sourceforge.net/ SPNEGO Library - open source GNU LGPL project that relies on the JAAS framework to simplify Authentication and Authorization]&lt;br /&gt;
&lt;br /&gt;
{{Authentication APIs}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Java APIs]]&lt;br /&gt;
[[Category:Computer access control]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Dujo</name></author>
	</entry>
</feed>