@@ -12,9 +12,8 @@ Overview of the Identity Store Interfaces
1212The Identity Store Interfaces are described in the following sections:
1313
1414* link:#the-identitystore-interface[The IdentityStore Interface]
15- * link:#the-identitystorehandler-interface[The IdentityStoreHandler Interface]
16- * link:#the-passwordhash-interface[The PasswordHash Interface]
1715* link:#the-remembermeidentitystore-interface[The RememberMeIdentityStore Interface]
16+ * link:#the-passwordhash-interface[The PasswordHash Interface]
1817
1918[[the-identitystore-interface]]
2019The IdentityStore Interface
@@ -39,10 +38,15 @@ and/or lookup user groups.
3938
4039* `DatabaseIdentityStoreDefinition` -- configures an identity store with the
4140parameters necessary to connect to an external database, validate user credentials,
42- and/or lookup user groups.
41+ and/or lookup user groups. You must supply a PasswordHash implementation when
42+ configuring a Database Identity Store. See link:#the-passwordhash-interface[The PasswordHash Interface].
4343
44- link:security-api004.html#running-the-built-in-database-identity-store-example[Running the Built-In Database Identity Store Example]
45- demonstrates usage of the built-in database identity store.
44+ An application can provide its own custom identity store, or use the built-in LDAP or database
45+ identity stores. For examples of both types, see:
46+
47+ * link:security-api004.html#running-the-built-in-database-identity-store-example[Running the Built-In Database Identity Store Example]
48+
49+ * link:security-api005.html#running-the-custom-identity-store-example[Running the Custom Identity Store Example]
4650
4751 Multiple implementations of `IdentityStore` may be present; if so, they are invoked
4852in priority order, based on each identity store's self-declared priority and
@@ -52,10 +56,9 @@ IdentityStores are primarily intended for use by implementations of
5256`HttpAuthenticationMechanisms` , but this is not a requirement.
5357They can be used by other types of authentication mechanisms as well, or by containers.
5458
55- [[the-identitystorehandler-interface]]
56- The IdentityStoreHandler Interface
57- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58-
59+ [[identitystorehandler]]
60+ IdentityStoreHandler
61+ ^^^^^^^^^^^^^^^^^^^^
5962Authentication mechanisms do not interact with `IdentityStore` directly; instead,
6063they call an `IdentityStoreHandler` . An implementation of the `IdentityStoreHandler`
6164interface provides a single method, `validate(Credential)` , which, when invoked,
@@ -81,7 +84,9 @@ An application may also supply its own `IdentityStoreHandler`, which can use any
8184desired algorithm to select and invoke on IdentityStores, and return an
8285aggregated (or non-aggregated) result.
8386
84- IdentityStore Interface Details:
87+ [[identitystoreinterface-methods]]
88+ IdentityStore Interface Methods
89+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8590
8691The IdentityStore interface itself has four methods:
8792
@@ -108,24 +113,6 @@ IdentityStores do check for this permission, if a SecurityManager is configured,
108113and the built-in IdentityStoreHandler invokes the `getCallerGroups()` method in
109114the context of a `PrivilegedAction` block.
110115
111- [[the-passwordhash-interface]]
112- The PasswordHash Interface
113- ~~~~~~~~~~~~~~~~~~~~~~~~~~
114-
115- Unlike some types of identity stores, for example LDAP directories,
116- databases can store and retrieve user passwords, but can't verify them natively.
117- Therefore, the built-in Database identity store must verify user passwords itself.
118- Most often, this involves generating a hash of the user's password for comparison
119- with a hash value stored in the database.
120-
121- In order to provide maximum flexibility and interoperability, the Database identity
122- store does not implement any specific password hashing algorithms. Instead, it
123- defines the PasswordHash interface, and expects the application to provide an
124- implementation of PasswordHash that can verify passwords from the specific store
125- the application will use. The PasswordHash implementation must be made available
126- as a dependent scoped bean, and is configured by providing the fully-qualified
127- name of the desired type as a hashAlgorithm value on the DatabaseIdentityStoreDefinition.
128-
129116[[the-remembermeidentitystore-interface]]
130117The RememberMeIdentityStore Interface
131118~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -191,6 +178,24 @@ as securely as possible (but does not necessarily need to be reliably persisted
191178the only impact of a "forgotten" session is that the user will be prompted to
192179log in again).
193180
181+ [[the-passwordhash-interface]]
182+ The PasswordHash Interface
183+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
184+
185+ Unlike some types of identity stores, for example LDAP directories,
186+ databases can store and retrieve user passwords, but can't verify them natively.
187+ Therefore, the built-in Database identity store must verify user passwords itself.
188+ Most often, this involves generating a hash of the user's password for comparison
189+ with a hash value stored in the database.
190+
191+ In order to provide maximum flexibility and interoperability, the Database identity
192+ store does not implement any specific password hashing algorithms. Instead, it
193+ defines the PasswordHash interface, and expects the application to provide an
194+ implementation of PasswordHash that can verify passwords from the specific store
195+ the application will use. The PasswordHash implementation must be made available
196+ as a dependent scoped bean, and is configured by providing the fully-qualified
197+ name of the desired type as a hashAlgorithm value on the DatabaseIdentityStoreDefinition.
198+
194199The PasswordHash algorithm defines three methods:
195200
196201* `initialize(Map<String,String> parameters)` -- initialize the PasswordHash with
0 commit comments