このコンテンツは選択した言語では利用できません。
15.3.3. Writing a login form
The
credentials
component provides both username
and password
properties, catering for the most common authentication scenario. These properties can be bound directly to the username and password fields on a login form. Once these properties are set, calling identity.login()
authenticates the user with the credentials provided. An example of a simple login form is as follows:
Similarly, the user is logged out by calling
#{identity.logout}
. This action clears the security state of the currently authenticated user and invalidate the user's session.