Azure Login 

Extension key

ok_azure_login

Package name

oliverkroener/ok-azure-login

Version

4.0

Language

en

Author

Oliver Kroener <https://www.oliver-kroener.de> & Contributors

License

This document is published under the Open Publication License.

Rendered

Sat, 14 Feb 2026 22:58:28 +0000

Installation 

How to install this extension via Composer and add the content elements to your TYPO3 site.

Microsoft Entra ID Setup 

Register an application in Microsoft Entra ID and configure OAuth 2.0 credentials and permissions.

Configuration 

Configure Azure credentials per site using the backend module or via global extension settings as fallback.

Frequently Asked Questions (FAQ) 

Common questions about setup and usage.

Get Help 

Where to get help and how to report issues.

Installation 

Install with Composer 

Install the extension via Composer:

composer req oliverkroener/ok-azure-login
Copied!

After installation, update the database schema to create the configuration table:

vendor/bin/typo3 database:updateschema
Copied!

See also Installing extensions in the TYPO3 Getting Started guide.

Include the static TypoScript 

  1. In the TYPO3 backend, go to the Template module
  2. Select the root page of your site
  3. Choose Info/Modify and click Edit the whole template record
  4. Switch to the Includes tab
  5. Add Azure Login from the list of available static templates

Add the content elements 

The extension provides two content elements, available under the Azure Login group in the New Content Element Wizard:

Azure Login
Renders a "Sign in with Microsoft" button. When a user authenticates via Microsoft Entra ID, the extension matches their email to an existing fe_users record and logs them in.
Azure Logout
Renders a "Sign out" button for logged-in users. Can optionally redirect to the Microsoft logout endpoint to sign the user out of Microsoft as well.

To add them:

  1. Go to the Page module and select the page where the login or logout button should appear
  2. Click Create new content element
  3. Select from the Azure Login group: either Azure Login or Azure Logout
  4. Configure the element settings (button theme, redirect URL, etc.) as needed
  5. Save and clear caches

Backend login 

The extension automatically registers a backend login provider. Once configured (see Configuration), a "Sign in with Microsoft" button appears as a separate tab on the TYPO3 backend login screen at /typo3/.

No additional setup is needed for backend login beyond configuring the Azure credentials. The backend redirect URI is automatically derived from the route configuration and shown as a read-only field with a copy button in the backend module. Register this URL in your Azure app registration.

Configuration of Microsoft Entra ID (formerly Azure AD) 

This guide walks you through registering an application in Microsoft Entra ID so the extension can authenticate users via the OAuth 2.0 authorization code flow.

  1. Register an application in Microsoft Entra ID

    Go to https://portal.azure.com and navigate to Microsoft Entra ID > App registrations.

  2. Configure the application

    • Name: Choose a descriptive name (e.g., "TYPO3 Azure Login").
    • Supported account types: Select "Accounts in this organizational directory only (Single tenant)".
  3. Add redirect URIs

    Under Redirect URI, select Web and add the callback URLs that match your TYPO3 site:

    • Frontend: https://your-domain.com/your-login-page (the page containing the Azure Login content element)
    • Backend: https://your-domain.com/typo3/azure-login/callback

    Click Register.

  4. Collect Tenant ID and Client ID

    On the Overview page, note down:

    • Directory (tenant) ID -- this is the Tenant ID
    • Application (client) ID -- this is the Client ID
  5. Create a client secret

    • Navigate to Certificates & secrets > Client secrets
    • Click New client secret
    • Enter a description and choose an expiration period
    • Click Add
  6. Configure API permissions

    The extension uses the authorization code flow with delegated permissions (not application permissions). It requests the following scopes:

    • openid -- Sign-in
    • profile -- Basic user profile
    • User.Read -- Read the signed-in user's profile (email, display name)

    To configure:

    • Navigate to API permissions
    • Click Add a permission > Microsoft Graph > Delegated permissions
    • Select: openid, profile, User.Read
    • Click Add permissions
    • Click Grant admin consent for [Your Organization]
  7. Configure in TYPO3

    Enter the collected credentials (Tenant ID, Client ID, Client Secret, frontend redirect URI) in the TYPO3 backend module at Web > Azure Login. The backend redirect URI is shown as a read-only field with a copy button.

    See Configuration for details.

Configuration 

After completing the Microsoft Entra ID setup, configure the extension in TYPO3 with the credentials obtained from Azure.

Extension settings (fallback) 

As a fallback, global credentials can be configured via Extension Configuration in the TYPO3 backend (Admin Tools > Settings > Extension Configuration > ok_azure_login).

These global settings are used when no per-site database configuration exists for the current site. This is useful for simple single-site installations or as a migration path from older versions of the extension.

The following settings are available:

tenantId

tenantId
type

string

Default

(empty)

The Directory (tenant) ID from your Microsoft Entra ID app registration.

clientId

clientId
type

string

Default

(empty)

The Application (client) ID from your Microsoft Entra ID app registration.

clientSecret

clientSecret
type

string

Default

(empty)

The Client Secret Value from your Microsoft Entra ID app registration.

redirectUriFrontend

redirectUriFrontend
type

string

Default

(empty)

The OAuth callback URL for frontend login.

Example: https://your-domain.com/your-login-page

redirectUriBackend

redirectUriBackend
type

string

Default

(empty)

Deprecated. The backend redirect URI is now automatically derived from the registered backend route (/typo3/azure-login/callback). This setting is ignored when using database configuration. It may still be used as a fallback in Extension Configuration for legacy setups.

Configuration resolution order 

The extension resolves Azure credentials in the following order:

  1. Database configuration for the current site root page (from the backend module)
  2. Extension Configuration (global fallback from ext_conf_template.txt)

If a database record exists for the site but has an empty Tenant ID, it is treated as unconfigured and the extension falls back to Extension Configuration.

TypoScript configuration 

The extension registers a static TypoScript template Azure Login that configures the Fluid template paths. Include it via the Template module (see Installation).

You can override the template paths via TypoScript constants:

plugin.tx_okazurelogin_login {
    view {
        templateRootPath = EXT:your_sitepackage/Resources/Private/Extensions/OkAzureLogin/Templates/
        partialRootPath = EXT:your_sitepackage/Resources/Private/Extensions/OkAzureLogin/Partials/
        layoutRootPath = EXT:your_sitepackage/Resources/Private/Extensions/OkAzureLogin/Layouts/
    }
}
Copied!

Content element settings 

Azure Login (frontend login)
Button Theme
Choose between a dark or light Microsoft button style.
Azure Logout (frontend logout)
Button Theme
Choose between a dark or light Microsoft button style.
Microsoft Sign-Out
When enabled, the user is redirected to the Microsoft logout endpoint to sign them out of Microsoft as well as TYPO3.
Redirect URL
Custom URL to redirect to after logout. Defaults to the site root.

How it works 

The authentication flow is handled entirely by the extension:

  1. The content element renders a "Sign in with Microsoft" button linking to the Microsoft Entra ID authorization endpoint.
  2. The user authenticates at Microsoft and is redirected back with an authorization code.
  3. A PSR-15 middleware intercepts the callback, exchanges the code for user information via the Microsoft Graph API, and injects the user data into the TYPO3 authentication chain.
  4. The TYPO3 authentication service looks up the user by email in the appropriate user table (fe_users or be_users).
  5. If a matching, non-disabled user is found, they are logged in and redirected to the return URL.

Security notes 

  • Encrypted secrets: Client secrets stored via the backend module are encrypted at rest using PHP Sodium (sodium_crypto_secretbox). The encryption key is derived from TYPO3's encryptionKey.
  • HMAC-signed state: The OAuth state parameter is HMAC-signed using TYPO3's encryptionKey and has a 10-minute TTL to prevent CSRF and replay attacks.
  • Per-site isolation: Each TYPO3 site can have its own Azure credentials, preventing credential leakage across multi-site installations.
  • Never commit client secrets to version control.
  • Use separate Azure app registrations for development, staging, and production environments.
  • Rotate client secrets regularly before their expiration date.

Frequently Asked Questions (FAQ) 

See chapter Installation.

Yes. The extension matches the authenticated Microsoft account to an existing fe_users or be_users record by email address. If no matching record is found, the login is rejected. The extension does not create new user accounts automatically.

Yes. For frontend login, add the Azure Login content element to a page. For backend login, the extension automatically adds a "Sign in with Microsoft" tab to the TYPO3 backend login screen. The frontend redirect URI must be configured manually. The backend redirect URI is auto-generated and can be copied from the backend configuration module. Both URIs must be registered in Microsoft Entra ID.

The extension requires delegated permissions only: openid, profile, and User.Read. No application permissions are needed. See the Azure Entra ID setup for details.

The recommended method is the backend module at Web > Azure Login. This allows per-site configuration with encrypted client secret storage.

As a fallback, global credentials can be set via Admin Tools > Settings > Extension Configuration > ok_azure_login.

See chapter Configuration.

Yes. The backend module stores configuration per TYPO3 site root page. Click on any page belonging to a site in the page tree, and the module resolves the correct site automatically. Each site can have its own Tenant ID, Client ID, Client Secret, and frontend redirect URI. The backend redirect URI is auto-generated from the route configuration.

When configured via the backend module, the client secret is encrypted using PHP Sodium (sodium_crypto_secretbox) before being stored in the database. The encryption key is derived from TYPO3's $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'].

The secret is never displayed in the backend module after saving.

See chapter Where to get help.

Sitemap