Extending Backoffice Login Page
The default login page shipped with the backoffice extension has three predefined fields: Username, Password, and Language. You can extend the login page by adding custom fields.
Prerequisites
For the purpose of the below example, generate two custom backoffice extensions: extensionOne and extensionTwo. Create the dependency between the extensions by the following code phrase in the extensionTwo/extensioninfo.xml:
<requires-extension name="extensionOne"/>
Context
The example shows how to add custom fields to both extensions to extend the Backoffice login page.
Adding New Fields to extensionOne
Extend login page for extensionOne with new fields.
Procedure
Results
Adding New Fields to extensionTwo
Extend login page for extensionTwo with enum and boolean fields.
Procedure
Results
Accessing Login Information
It is possible to access information provided when logging in to Backoffice.
Context
To access information provided while logging in, use the LoginInformationHandler. This handler allows you to define a current login screen configuration, store the login information, and then read the stored login information. See the example.
Procedure
Access the name of the tenant (a field defined in extensionOne) provided by the user on login. Use the following code phrase:
loginInformationHandler.getLoginInformation(“tenant”);