---
title: "Backend login form API"
manual: "TYPO3 Explained"
version: "11.5"
permalink: "https://docs.typo3.org/permalink/t3coreapi:login-provider@11.5"
source: "ApiOverview/Backend/LoginProvider.rst"
rendered: "2026-10-21T15:30:00+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v11 has reached end-of-life as of October 31th 2024 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# Backend login form API {#login-provider}

## Registering a login provider {#registering-a-login-provider}

The concept of the backend login is based on "login providers".

A login provider can be registered within your `LocalConfiguration.php`
or `AdditionalConfiguration.php`  like this:

**typo3conf/AdditionalConfiguration.php**

```php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'][1433416020] = [
    'provider' => \MyVendor\MyExtension\LoginProvider\CustomLoginProvider::class,
    'sorting' => 50,
    'iconIdentifier' => 'actions-key',
    'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang.xlf:login.link'
];
```

<!-- TODO: no Markdown rendering for "versionadded" -->

The option iconIdentifier has been introduced. As FontAwesome will
be phased out developers are encouraged to use this option instead of
icon-class, which expects a FontAwesome class.

The settings are defined as:

-   **`provider`**

    The login provider class name, which must implement
    `\TYPO3\CMS\Backend\LoginProvider\LoginProviderInterface`.

-   **`sorting`**

    The sorting is important for the ordering of the links to the possible
    login providers on the login screen.

-   **`iconIdentifier`**

    Accepts any icon identifier that is available in the Icon Registry.

-   **`label`**

    The label for the login provider link on the login screen.

For a new login provider you have to register a **new key** \- by best practice
the current unix timestamp - in
`$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders']`.

If your login provider extends another one, you may only overwrite necessary
settings. An example would be to extend an existing provider and
replace its registered `provider` class with your custom class.

**typo3conf/AdditionalConfiguration.php**

```php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'][1433416020]['provider'] =
    \MyVendor\MyExtension\LoginProvider\CustomProviderExtendingUsernamePasswordLoginProvider::class
```

## LoginProviderInterface {#loginproviderinterface}

The LoginProviderInterface contains only one method:

-   **interface LoginProviderInterface**

    -   *Fully qualified name:* `\TYPO3\CMS\Backend\LoginProvider\LoginProviderInterface`

    Interface for Backend Login providers

    -   **render(TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView $view, TYPO3\\\\CMS\\\\Core\\\\Page\\\\PageRenderer $pageRenderer, TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\LoginController $loginController)**

        Render the login HTML

        Implement this method and set the template for your form.
        This is also the right place to assign data to the view
        and add necessary JavaScript resources to the page renderer.

        A good example is EXT:openid

        -   **Example:**

            $view->setTemplatePathAndFilename($pathAndFilename);
            $view->assign('foo', 'bar');

        -   *param TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView $view:* the view
        -   *param TYPO3\\\\CMS\\\\Core\\\\Page\\\\PageRenderer $pageRenderer:* the pageRenderer
        -   *param TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\LoginController $loginController:* the loginController

## The View {#the-view}

As mentioned above, the `render` method gets the Fluid StandaloneView as first parameter.
You have to set the template path and filename using the methods of this object.
The template file must only contain the form fields, not the form-tag.
Later on, the view renders the complete login screen.

View requirements:

-   The template must use the `Login`-layout provided by the Core `<f:layout name="Login">`.
-   Form fields must be provided within the section `<f:section name="loginFormFields">`.

**EXT:my_sitepackage/Resources/Private/Templates/MyLoginForm.html**

```html
<f:layout name="Login" />
<f:section name="loginFormFields">
    <div class="form-group t3js-login-openid-section" id="t3-login-openid_url-section">
        <div class="input-group">
            <input
                type="text"
                id="openid_url"
                name="openid_url"
                value="{presetOpenId}"
                autofocus="autofocus"
                placeholder="{f:translate(key: 'openId', extensionName: 'openid')}"
                class="form-control input-login t3js-clearable t3js-login-openid-field"
            >
            <div class="input-group-addon">
                <span class="fa fa-openid"></span>
            </div>
        </div>
    </div>
</f:section>
```

## Examples {#examples}

Within the Core you can find the standard implementation in the system extension
`backend`:

See class [EXT:backend/Classes/LoginProvider/UsernamePasswordLoginProvider.php (GitHub)](https://github.com/typo3/typo3/blob/11.5/typo3/sysext/backend/Classes/LoginProvider/UsernamePasswordLoginProvider.php)
with its template [EXT:backend/Resources/Private/Templates/Login/UserPassLoginForm.html (GitHub)](https://github.com/typo3/typo3/blob/11.5/typo3/sysext/backend/Resources/Private/Templates/Login/UserPassLoginForm.html).
