Jump to:navigation, search
Wiki








































Configuration of OAuth2 authentications

Last adaptation to the version: 14.1.0(08.2025)

New:
  • Command in own menu
Last updated: 
notempty
This article refers to a Beta version
-
Access: UTM-IP:Port or UTM-URL:Port
Port as configured at Network / Appliance Settings / Webserver
Default-Port: 11115
i.e.: https://utm.ttt-point.de:11115
Default: https://192.168.175.1:11115
Authentication OAuth 2

https://devwiki.intern.securepoint.de/UTM/AUTH/OAuth2



OAuth 2 UTMuser@firewall.name.fqdn Authentication OAuth 2 Verbindungen für Mailconnector und Mailrelay

OAuth 2 connections can be created and edited in this menu.

Depending on the provider selection the configuration steps will change. The following providers are available:

  • Google Workspace
  • Microsoft 365 (Secret Client Key)
  • Microsoft 365 (Certificate)

Create new connections with the button Add OAuth 2 connection

Google Workspace

Google Workspace
Caption Value Description Add OAuth 2 connection UTMuser@firewall.name.fqdn
Name:     Name of the OAuth 2 connection
Provider: Google Workspace Provider selection
Service account:     The Google Workspace service account is entered
User account: »alice@ttt-point.de The user accounts are selected
Certificate: Google_Workspace-OAuth2_cert The certificate that is uploaded in Azure is selected

Microsoft 365

Microsoft 365

In order to use Microsoft 365, configured Azure Apps are necessary.
Show Azure Apps configuration for mail connector
hide
Klicken für dauerhafte Anzeige



































  • Note

    This article includes descriptions of third-party software and is based on the status at the time this page was created.
    Changes to the user interface on the part of the manufacturer are possible at any time and must be taken into account accordingly in the implementation.
    All information without warranty.

  • In order to use the Mail Connector with Microsoft 365, the following information is required:
    • Application ID
    • Client ID
    • Secret client key
    This guide shows an example of the preparations and setting required in Microsoft Azure
    • Launch Azure Active Directory admin center
    • Note down/Copy Tenant ID from the Azure Active Directory menu
    • Register new app under theApp registration menu under the New registration button
    • Assign a unique name and click the register button
    • In the API permissions menu, click the Add a permission button.
    • Select permission for Office 365 Exchange Online in the APIs my organization uses tab
    • Add IMAP.AccessAsApp permission for Office 365 Exchange Online
    • In the menu API permissions activate the entry Grant admin consent for [...].
    • Create a Client secret in the Certificates & secrets menu
    • Note down Value, will be entered as Secret Client Key when adding an OAuth 2 connection
    • Open menu Enterprise Applications and select app
    • Note down from the app properties Application ID and Object ID.
    • Open Powershell on Windows Client Administrator, import ExchangeOnlineManagement and connect to tenant
    • Select the recipient mailbox in the Exchange admin center and choose Read and manage (Full Access) as delegation.
    • Add member for Mailbox Delegation
    • This completes the configuration in Microsoft Azure.
      The further configuration is done in the UTM in the menu
      Applications Mail Connector  Area Services with button Add Mail Connector Service

    anf in the tab
    OAuth2 with the Add OAuth2 connection button.

    • notempty
      The Microsoft servers may take up to 30 minutes before access works













    Konfiguration Entra ID Apps für das Mailrelay/Smarthost & Exchange Online zeigen
    hide
    Klicken für dauerhafte Anzeige





























    Preliminary note





  • Note

    This article includes descriptions of third-party software and is based on the status at the time this page was created.
    Changes to the user interface on the part of the manufacturer are possible at any time and must be taken into account accordingly in the implementation.
    All information without warranty.

  • Um mit dem UTM Smarthost E-Mails an Exchange online (M365) versenden zu können (z.B. für das Mailrelay)
    • ist eine Entra ID App mit der Berechtigung SMTP.SendAsApp erforderlich.
    • Dieser App muss der Zugriff auf das Exchange Online E-Mail-Konto gewährt werden

    Konfiguration Entra-ID App

    • Microsoft Microsoft Entra Admin Center starten
    • Neue App Registrieren
    • Api-Berechtigung hinzufügen: Reiter Von meiner Organisation verwendete APIs wählen
    • Berechtigung für Office 365 Exchange Online wählen
      Administratorzustimmung erteilen
    • Clientgeheimnis hinzufügen und Wert notieren
      (Wird beim Hinzufügen einer OAuth 2 Verbindung als Geheimer Clientschlüssel benötigt)
      Der Wert des Clientschlüssels kann nur unmittelbar nach Erstellung angezeigt werden
    • Aus der App-Übersicht die Anwendungs-ID (Client) und die Verzeichnis-ID (Mandant) kopieren
      (Wird in der UTM beim Hinzufügen einer OAuth 2 Verbindung als Anwendungs-ID bzw. Mandanten-ID benötigt)
    • Aus dem Menü Unternehmens Apps Untermenü Alle Anwendungen die angelegte App wählen und die Objekt ID kopieren
      (Wird für die Vergabe der Berechtigung per Powershell benötigt)














    Show step-by-step instructions
    hide





    1. 2. 3.
    Abb.1 Abb.2 Abb.3
    Abbildungen
    Fig.1
    • Anmelden unter Microsoft Entra
    • Menü App-Registrierung 1
    • Schaltfläche Neue Registrierung 2
    Fig.2
  • Eindeutigen Namen vergeben 3
  • Schaltfläche Registrieren klicken 4
  • Fig.3
  • Click Add a permission button 5
  • Select the tab APIs my organization uses 6
  • Select permission for Office 365 Exchange Online 7
  • Fig.4
  • Click Application permissions button 8
  • Search for smtp 9
  • Checkmark SMTP.SendAsApp 10
  • Click the Add permissions button 11
  • Fig.5
  • Select entry Grant admin consent for [...] 12
  • Click the Yes button
  • Fig.6
  • Administratorzustimmung erfolgreich gewährt
  • Fig.7
  • Menu Certificates & secrets 14
  • Tab Client secrets 15
  • Entry New Client secret 16
  • Enter unique description 17
  • Select desired duration (max. 24 months) 18
  • Click Add button
  • Fig.8
  • Wert notieren 20
    Wird beim Hinzufügen einer OAuth 2 Verbindung als Geheimer Clientschlüssel benötigt
  • Der Wert des Clientschlüssels kann nur unmittelbar nach Erstellung angezeigt werden.
    Nach einem Reload der Seite ist dieser nicht mehr einsehbar!
  • Fig.9
    Aus der App-Übersicht 21 folgende Werte kopieren:
    • Anwendungs-ID (Client) 22
      Wird in der UTM beim Hinzufügen einer OAuth 2 Verbindung als Anwendungs-ID benötigt
    • Verzeichnis-ID (Mandant) 23
      Wird in der UTM beim Hinzufügen einer OAuth 2 Verbindung als Mandanten-ID benötigt
    • Die hier aufgeführte Objekt-ID wird nicht benötigt!
    Fig.10
  • Menü Unternehmens Apps 24
  • Untermenü Alle Anwendungen 25
  • App wählen 26
  • Objekt ID 27 kopieren
    Wird für die Vergabe der Berechtigung per Powershell benötigt

  • Konfiguration von Exchange Online

    Powershellbefehle
    Für die Konfiguration von Exchange Online, wird eine PowerShell benötigt
    hide
    Klicken für dauerhafte Anzeige
    Diese muss nicht zwingend unter Windows benutzt werden.
    Eine Anleitung für die Installation von Powershell unter Ubuntu existiert von Microsoft selbst:
    https://learn.microsoft.com/de-de/powershell/scripting/install/install-ubuntu?view=powershell-7.5
      • In der Powershell muss zunächst das Modul für Exchange Online heruntergeladen und aktiviert werden
        Install-Module ExchangeOnlineManagement
        Import-Module ExchangeOnlineManagement
      • ExchangeOnlineManagement mit dem Tenant (Verzeichnis-ID (Mandant) Abb.9 Nr. 23) verbinden
        Connect-ExchangeOnline -Organization "<Verzeichnis-ID (Mandant)>"
      • SMTP-Authentication für das Postfach aktivieren, das Smarthost verwendet werden soll
        Set-CASMailbox -Identity "<MAILBOX>" -SmtpClientAuthenticationDisabled $false
      • Es wird ein Dienst benötigt, dem die Berechtigung für den Mailbox-Zugriff erteilt werden kann.
        • APPLICATION_ID aus Abb.9 Nr.22
        • OBJECT_ID aus Abb.10 Nr. 27
        • Der Parameter 'DisplayName' ist hierbei optional, hilft aber im Nachhinein nachzuvollziehen, wer Zugriff auf die Mailbox hat.
          New-ServicePrincipal -AppId "<APPLICATION_ID>" -ObjectId "<OBJECT_ID>" -DisplayName "<DESCRIPTION>"
      • Berechtigung für Mailbox-Zugriff erteilen:
        OBJECT_ID aus Abb.10 Nr. 27
        Add-MailboxPermission -Identity "<MAILBOX>" -User "<OBJECT_ID>" -AccessRights FullAccess

    Microsoft 365 (Secret client key)

    Microsoft 365 (Secret client key)
    Name:     Name of the OAuth 2 connection
    Provider: Microsoft 365 (Secret client key) Provider selection
    Application ID:     The application ID is entered
    In Microsoft Azure in the App property under Application ID
    Tenant ID:     The tenant's ID is entered
    In Microsoft Azure in the menu Azure Active Directory under Tenant ID
    Secret client key:     The secret client key is entered
    In Microsoft Azure in the menu Certificates & secrets in the tab Client secrets under Value

    Microsoft 365 (certificate)

    Microsoft 365 (certificate)
    Name:     Name of the OAuth 2 connection
    Provider: Microsoft 365 (certificate) Provider selection
    Application ID:     The application ID is entered
    In Microsoft Azure in the App property under Application ID
    Tenant ID:     The tenant's ID is entered
    In Microsoft Azure in the menu Azure Active Directory under Tenant ID
    Certificate: CC-OAuth2-MS365_cert The certificate that is uploaded in Azure is selected