The authentication features provided by Seam Security are built upon JAAS (Java Authentication and Authorization Service), and as such provide a robust and highly configurable API for handling user authentication. However, for less complex authentication requirements Seam offers a much more simplified method of authentication that hides the complexity of JAAS.
The simplified authentication method uses a built-in JAAS login module, SeamLoginModule
, which delegates authentication to one of your own Seam components. This login module is already configured inside Seam as part of a default application policy and as such does not require any additional configuration files. It allows you to write an authentication method using the entity classes that are provided by your own application. Configuring this simplified form of authentication requires the identity
component to be configured in components.xml
:
<components xmlns="https://jboss.com/products/seam/components"
xmlns:core="https://jboss.com/products/seam/core"
xmlns:security="https://jboss.com/products/seam/security"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://jboss.com/products/seam/core https://jboss.com/products/seam/core-1.2.xsd
https://jboss.com/products/seam/components https://jboss.com/products/seam/components-1.2.xsd
https://jboss.com/products/seam/drools https://jboss.com/products/seam/drools-1.2.xsd"
https://jboss.com/products/seam/security https://jboss.com/products/seam/security-1.2.xsd">
<security:identity authenticate-method="#{authenticator.authenticate}"/>
</components>
If you wish to use the advanced security features such as rule-based permission checks, all you need to do is include the Drools (JBoss Rules) jars in your classpath, and add some additional configuration, described later.
The EL expression #{authenticator.authenticate}
is a method binding indicating that the authenticate
method of the authenticator
component will be used to authenticate the user.