Add excluded Entra groups for the Microsoft sign-in
Some checks are pending
CI / PHP lint (7.4) (pull_request) Waiting to run
CI / PHP lint (8.0) (pull_request) Waiting to run
CI / PHP lint (8.1) (pull_request) Waiting to run
CI / PHP lint (8.2) (pull_request) Waiting to run
CI / PHP lint (8.3) (pull_request) Waiting to run
CI / PHP lint (8.4) (pull_request) Waiting to run
CI / WordPress Coding Standards (pull_request) Waiting to run
CI / WordPress.org Plugin Check (pull_request) Waiting to run

New "Excluded Entra groups" card on the Security tab. Members of these
groups (nested memberships count) can never sign in with Microsoft, even
if they are in an allowed group.

A hit in the ID token's groups claim refuses immediately. Otherwise the
plugin always asks Microsoft Graph (checkMemberGroups), because a groups
claim can be filtered in the app registration and cannot prove
non-membership. Graph errors refuse the sign-in (fail closed).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-23 16:43:10 +00:00
parent 5c9b19399a
commit 791f43a80b
12 changed files with 372 additions and 196 deletions

View file

@ -56,7 +56,7 @@ msgstr "Dieses Icon verwenden"
msgid "Copied!"
msgstr "Kopiert!"
#: includes/class-m365-login-admin.php:233 includes/class-m365-login-admin.php:848 includes/class-m365-login-admin.php:1102 includes/class-m365-login-admin.php:1147
#: includes/class-m365-login-admin.php:233 includes/class-m365-login-admin.php:848 includes/class-m365-login-admin.php:1112 includes/class-m365-login-admin.php:1157
msgid "Copy"
msgstr "Kopieren"
@ -914,136 +914,152 @@ msgid "Membership is read from the \"groups\" claim of the ID token when present
msgstr "Die Mitgliedschaft wird aus dem „groups“-Claim des ID-Tokens gelesen, falls vorhanden; andernfalls fragt das Plugin Microsoft Graph (Anwendungsberechtigung „User.Read.All“ oder „Directory.Read.All“). Funktioniert beides nicht, wird die Anmeldung abgelehnt."
#: includes/class-m365-login-admin.php:1085
msgid "Excluded Entra groups (optional)"
msgstr "Ausgeschlossene Entra-Gruppen (optional)"
#: includes/class-m365-login-admin.php:1086
msgid "Members of these groups can never sign in with Microsoft even if they are in an allowed group. Nested memberships count."
msgstr "Mitglieder dieser Gruppen können sich nie per Microsoft anmelden auch nicht, wenn sie in einer erlaubten Gruppe sind. Verschachtelte Mitgliedschaften zählen."
#: includes/class-m365-login-admin.php:1088
msgid "No groups excluded."
msgstr "Keine Gruppen ausgeschlossen."
#: includes/class-m365-login-admin.php:1090
msgid "The plugin asks Microsoft Graph on every sign-in (application permission \"User.Read.All\" or \"Directory.Read.All\"), because a \"groups\" claim may be filtered and cannot prove that someone is not a member. If the check fails, the sign-in is refused. Password sign-in is not affected combine with button-only mode if needed."
msgstr "Das Plugin fragt bei jeder Anmeldung Microsoft Graph (Anwendungsberechtigung „User.Read.All“ oder „Directory.Read.All“), weil ein „groups“-Claim gefiltert sein kann und nicht beweist, dass jemand kein Mitglied ist. Schlägt die Prüfung fehl, wird die Anmeldung abgelehnt. Die Passwort-Anmeldung ist nicht betroffen bei Bedarf mit dem Nur-Button-Modus kombinieren."
#: includes/class-m365-login-admin.php:1095
msgid "Button-only mode"
msgstr "Nur-Button-Modus"
#: includes/class-m365-login-admin.php:1086
#: includes/class-m365-login-admin.php:1096
msgid "Hides the username/password fields (on wp-login.php and in wp_login_form() forms) and refuses every interactive password sign-in on the site, including custom login forms. Application passwords, REST, XML-RPC and WP-CLI are not affected."
msgstr "Blendet die Benutzername/Passwort-Felder aus (auf wp-login.php und in wp_login_form()-Formularen) und lehnt jede interaktive Passwort-Anmeldung auf der Website ab, auch in eigenen Login-Formularen. Anwendungspasswörter, REST, XML-RPC und WP-CLI sind nicht betroffen."
#: includes/class-m365-login-admin.php:1091
#: includes/class-m365-login-admin.php:1101
msgid "Show only the Microsoft button on the login page"
msgstr "Auf der Login-Seite nur den Microsoft-Button anzeigen"
#: includes/class-m365-login-admin.php:1092
#: includes/class-m365-login-admin.php:1102
msgid "Becomes active once the connection is configured. Make sure your own account can sign in via Microsoft before enabling this."
msgstr "Wird aktiv, sobald die Verbindung eingerichtet ist. Vor dem Aktivieren sicherstellen, dass das eigene Konto sich per Microsoft anmelden kann."
#: includes/class-m365-login-admin.php:1097
#: includes/class-m365-login-admin.php:1107
msgid "Fallback link (keep it secret)"
msgstr "Fallback-Link (geheim halten)"
#: includes/class-m365-login-admin.php:1098
#: includes/class-m365-login-admin.php:1108
msgid "Opening this link shows the password form again in that browser for 30 minutes and allows password sign-in there. Bookmark it somewhere safe it is your way back in if Microsoft sign-in ever breaks."
msgstr "Wer diesen Link öffnet, sieht in diesem Browser 30 Minuten lang wieder das Passwort-Formular und kann sich dort mit Passwort anmelden. Sicher aufbewahren er ist der Weg zurück, falls die Microsoft-Anmeldung einmal nicht funktioniert."
#: includes/class-m365-login-admin.php:1106
#: includes/class-m365-login-admin.php:1116
msgid "Generate a new key when saving"
msgstr "Beim Speichern einen neuen Schlüssel erzeugen"
#: includes/class-m365-login-admin.php:1109
#: includes/class-m365-login-admin.php:1119
msgid "A key is generated automatically the first time you save these settings."
msgstr "Beim ersten Speichern dieser Einstellungen wird automatisch ein Schlüssel erzeugt."
#. translators: %s: PHP constant
#: includes/class-m365-login-admin.php:1115
#: includes/class-m365-login-admin.php:1125
msgid "Emergency switch: add %s to wp-config.php to disable button-only mode entirely."
msgstr "Notschalter: %s in die wp-config.php eintragen, um den Nur-Button-Modus vollständig abzuschalten."
#. translators: %s: PHP constant
#: includes/class-m365-login-admin.php:1124
#: includes/class-m365-login-admin.php:1134
msgid "What the plugin does to keep sign-ins safe"
msgstr "So schützt das Plugin die Anmeldung"
#: includes/class-m365-login-admin.php:1126
#: includes/class-m365-login-admin.php:1136
msgid "OpenID Connect authorization code flow with PKCE (S256) no tokens ever pass through the browser."
msgstr "OpenID Connect Authorization Code Flow mit PKCE (S256) Tokens laufen nie durch den Browser."
#: includes/class-m365-login-admin.php:1127
#: includes/class-m365-login-admin.php:1137
msgid "Single-use state and nonce values bound to the browser via an HttpOnly cookie (CSRF and replay protection)."
msgstr "Einmalige State- und Nonce-Werte, per HttpOnly-Cookie an den Browser gebunden (CSRF- und Replay-Schutz)."
#: includes/class-m365-login-admin.php:1128
#: includes/class-m365-login-admin.php:1138
msgid "ID token signature verified against Microsofts published signing keys; issuer, audience, tenant, expiry and nonce are checked."
msgstr "Signatur des ID-Tokens wird gegen Microsofts veröffentlichte Signaturschlüssel geprüft; Issuer, Audience, Tenant, Ablauf und Nonce werden kontrolliert."
#: includes/class-m365-login-admin.php:1129
#: includes/class-m365-login-admin.php:1139
msgid "Client secret encrypted at rest; sign-in never creates accounts or changes passwords."
msgstr "Client Secret verschlüsselt gespeichert; die Anmeldung legt nie Konten an und ändert keine Passwörter."
#: includes/class-m365-login-admin.php:1137
#: includes/class-m365-login-admin.php:1147
msgid "Save changes"
msgstr "Änderungen speichern"
#: includes/class-m365-login-admin.php:1143
#: includes/class-m365-login-admin.php:1153
msgid "Redirect URI"
msgstr "Umleitungs-URI (Redirect URI)"
#: includes/class-m365-login-admin.php:1144
#: includes/class-m365-login-admin.php:1154
msgid "Register this URI in your app registration under Authentication → Web → Redirect URIs:"
msgstr "Diese URI in der App-Registrierung unter Authentifizierung → Web → Umleitungs-URIs eintragen:"
#: includes/class-m365-login-admin.php:1150
#: includes/class-m365-login-admin.php:1160
msgid "Plain permalinks are active, so the callback uses a query string. If you enable pretty permalinks later, the redirect URI changes and must be updated in Entra ID."
msgstr "Einfache Permalinks sind aktiv, daher verwendet der Callback einen Query-String. Werden später sprechende Permalinks aktiviert, ändert sich die Umleitungs-URI und muss in Entra ID angepasst werden."
#: includes/class-m365-login-admin.php:1153
#: includes/class-m365-login-admin.php:1163
msgid "Your site does not use HTTPS. Microsoft only accepts http:// redirect URIs for localhost; production sites must use HTTPS."
msgstr "Diese Website nutzt kein HTTPS. Microsoft akzeptiert http://-Umleitungs-URIs nur für localhost; produktive Websites benötigen HTTPS."
#: includes/class-m365-login-admin.php:1158
#: includes/class-m365-login-admin.php:1168
msgid "Setup guide: app registration"
msgstr "Anleitung: App-Registrierung"
#: includes/class-m365-login-admin.php:1160
#: includes/class-m365-login-admin.php:1170
msgid "Open entra.microsoft.com → Identity → Applications → App registrations → New registration."
msgstr "entra.microsoft.com → Identität → Anwendungen → App-Registrierungen → Neue Registrierung öffnen."
#: includes/class-m365-login-admin.php:1161
#: includes/class-m365-login-admin.php:1171
msgid "Name: e.g. \"WordPress login\". Supported account types: \"Accounts in this organizational directory only\" (single tenant)."
msgstr "Name: z. B. „WordPress Login“. Unterstützte Kontotypen: „Nur Konten in diesem Organisationsverzeichnis“ (Single Tenant)."
#: includes/class-m365-login-admin.php:1162
#: includes/class-m365-login-admin.php:1172
msgid "Redirect URI: choose the platform Web and paste the URI shown above. Then click Register."
msgstr "Umleitungs-URI: Plattform „Web“ wählen und die oben angezeigte URI einfügen. Dann auf „Registrieren“ klicken."
#: includes/class-m365-login-admin.php:1163
#: includes/class-m365-login-admin.php:1173
msgid "On the Overview page copy the Application (client) ID and the Directory (tenant) ID into the Connection tab."
msgstr "Auf der Übersichtsseite die Anwendungs-ID (Client) und die Verzeichnis-ID (Mandant) in den Tab „Verbindung“ kopieren."
#: includes/class-m365-login-admin.php:1164
#: includes/class-m365-login-admin.php:1174
msgid "Authentication: leave \"ID tokens\" unchecked (the plugin uses the authorization code flow) and \"Allow public client flows\" on No."
msgstr "Authentifizierung: „ID-Token“ nicht anhaken (das Plugin nutzt den Authorization Code Flow) und „Öffentliche Clientflows zulassen“ auf „Nein“ lassen."
#: includes/class-m365-login-admin.php:1165
#: includes/class-m365-login-admin.php:1175
msgid "Token configuration → Add optional claim → ID → tick \"email\" → Add. Confirm the API permission prompt."
msgstr "Tokenkonfiguration → Optionalen Anspruch hinzufügen → ID → „email“ anhaken → Hinzufügen. Die Rückfrage zur API-Berechtigung bestätigen."
#: includes/class-m365-login-admin.php:1166
#: includes/class-m365-login-admin.php:1176
msgid "Pick the authentication method on the Connection tab and follow its step-by-step guide (client secret or certificate)."
msgstr "Im Tab „Verbindung“ die Authentifizierungsmethode wählen und der zugehörigen Schritt-für-Schritt-Anleitung folgen (Client Secret oder Zertifikat)."
#: includes/class-m365-login-admin.php:1167
#: includes/class-m365-login-admin.php:1177
msgid "Optional: restrict who may use the app under Enterprise applications → your app → Properties → \"Assignment required\" = Yes, then assign users/groups."
msgstr "Optional: Unter Unternehmensanwendungen → deine App → Eigenschaften → „Zuweisung erforderlich“ = Ja einschränken, wer die App nutzen darf, und dann Benutzer/Gruppen zuweisen."
#: includes/class-m365-login-admin.php:1169
#: includes/class-m365-login-admin.php:1179
msgid "Required API permission: openid, profile, email (delegated) granted by default."
msgstr "Benötigte API-Berechtigungen: openid, profile, email (delegiert) standardmäßig vorhanden."
#: includes/class-m365-login-admin.php:1170
#: includes/class-m365-login-admin.php:1180
msgid "Optional, for group restrictions and the user sync: application permissions GroupMember.Read.All and User.Read.All (Microsoft Graph) with admin consent."
msgstr "Optional für Gruppen-Beschränkungen und den Benutzer-Sync: Anwendungsberechtigungen GroupMember.Read.All und User.Read.All (Microsoft Graph) mit Administratorzustimmung."
#: includes/class-m365-login-admin.php:1174
#: includes/class-m365-login-admin.php:1184
msgid "Shortcode"
msgstr "Shortcode"
#: includes/class-m365-login-admin.php:1175
#: includes/class-m365-login-admin.php:1185
msgid "Place the button on a custom login page:"
msgstr "Button auf einer eigenen Login-Seite platzieren:"
#: includes/class-m365-login-admin.php:1177
#: includes/class-m365-login-admin.php:1187
msgid "More options on the Button tab under \"Custom login page\"."
msgstr "Weitere Optionen im Tab „Button“ unter „Eigene Login-Seite“."
@ -1051,75 +1067,79 @@ msgstr "Weitere Optionen im Tab „Button“ unter „Eigene Login-Seite“."
msgid "Password sign-in is disabled on this site. Please use the Microsoft button."
msgstr "Die Anmeldung mit Passwort ist auf dieser Website deaktiviert. Bitte den Microsoft-Button verwenden."
#: includes/class-m365-login-auth.php:827
#: includes/class-m365-login-auth.php:906
msgid "Password sign-in is temporarily enabled for this browser (30 minutes)."
msgstr "Die Passwort-Anmeldung ist für diesen Browser vorübergehend aktiviert (30 Minuten)."
#: includes/class-m365-login-auth.php:848 includes/class-m365-login-graph.php:63
#: includes/class-m365-login-auth.php:927 includes/class-m365-login-graph.php:63
msgid "Microsoft login is not configured yet."
msgstr "Die Microsoft-Anmeldung ist noch nicht eingerichtet."
#: includes/class-m365-login-auth.php:849
#: includes/class-m365-login-auth.php:928
msgid "The login request expired or was invalid. Please try again."
msgstr "Die Anmeldeanfrage ist abgelaufen oder ungültig. Bitte erneut versuchen."
#: includes/class-m365-login-auth.php:850
#: includes/class-m365-login-auth.php:929
msgid "Microsoft sign-in was cancelled."
msgstr "Die Microsoft-Anmeldung wurde abgebrochen."
#: includes/class-m365-login-auth.php:851
#: includes/class-m365-login-auth.php:930
msgid "Microsoft returned an error. Please try again."
msgstr "Microsoft hat einen Fehler gemeldet. Bitte erneut versuchen."
#: includes/class-m365-login-auth.php:852
#: includes/class-m365-login-auth.php:931
msgid "Could not complete the sign-in with Microsoft. Please try again or contact an administrator."
msgstr "Die Anmeldung über Microsoft konnte nicht abgeschlossen werden. Bitte erneut versuchen oder einen Administrator kontaktieren."
#: includes/class-m365-login-auth.php:853
#: includes/class-m365-login-auth.php:932
msgid "The Microsoft sign-in could not be verified."
msgstr "Die Microsoft-Anmeldung konnte nicht verifiziert werden."
#: includes/class-m365-login-auth.php:854
#: includes/class-m365-login-auth.php:933
msgid "Your Microsoft account did not provide an e-mail address."
msgstr "Das Microsoft-Konto hat keine E-Mail-Adresse übermittelt."
#: includes/class-m365-login-auth.php:855
#: includes/class-m365-login-auth.php:934
msgid "Your e-mail domain is not allowed to sign in here."
msgstr "Diese E-Mail-Domain ist hier nicht zur Anmeldung zugelassen."
#: includes/class-m365-login-auth.php:856
#: includes/class-m365-login-auth.php:935
msgid "No WordPress account exists for your Microsoft e-mail address."
msgstr "Für die E-Mail-Adresse des Microsoft-Kontos existiert kein WordPress-Konto."
#: includes/class-m365-login-auth.php:857
#: includes/class-m365-login-auth.php:936
msgid "This WordPress account is linked to a different Microsoft account. Please contact an administrator."
msgstr "Dieses WordPress-Konto ist mit einem anderen Microsoft-Konto verknüpft. Bitte einen Administrator kontaktieren."
#: includes/class-m365-login-auth.php:858
#: includes/class-m365-login-auth.php:937
msgid "You are not allowed to sign in with this account."
msgstr "Die Anmeldung mit diesem Konto ist nicht erlaubt."
#: includes/class-m365-login-auth.php:859
#: includes/class-m365-login-auth.php:938
msgid "Your Microsoft account is not a member of a group that is allowed to sign in here."
msgstr "Das Microsoft-Konto ist in keiner Gruppe, die sich hier anmelden darf."
#: includes/class-m365-login-auth.php:860
#: includes/class-m365-login-auth.php:939
msgid "Your group membership could not be verified. Please contact an administrator."
msgstr "Die Gruppenmitgliedschaft konnte nicht geprüft werden. Bitte einen Administrator kontaktieren."
#: includes/class-m365-login-auth.php:861
#: includes/class-m365-login-auth.php:940
msgid "Your Microsoft account is a member of a group that is not allowed to sign in here."
msgstr "Dein Microsoft-Konto ist Mitglied einer Gruppe, die sich hier nicht anmelden darf."
#: includes/class-m365-login-auth.php:941
msgid "The fallback key is not valid."
msgstr "Der Fallback-Schlüssel ist ungültig."
#: includes/class-m365-login-auth.php:862
#: includes/class-m365-login-auth.php:942
msgid "Too many attempts. Please wait 15 minutes."
msgstr "Zu viele Versuche. Bitte 15 Minuten warten."
#: includes/class-m365-login-auth.php:863
#: includes/class-m365-login-auth.php:943
msgid "Too many sign-in attempts from your connection. Please wait a few minutes and try again."
msgstr "Zu viele Anmeldeversuche von dieser Verbindung. Bitte ein paar Minuten warten und erneut versuchen."
#: includes/class-m365-login-auth.php:864 includes/class-m365-login-sync.php:1520
#: includes/class-m365-login-auth.php:944 includes/class-m365-login-sync.php:1520
msgid "This account has been deactivated."
msgstr "Dieses Konto wurde deaktiviert."
@ -1187,51 +1207,51 @@ msgstr "Sicherheitsgruppe"
msgid "Microsoft 365 group"
msgstr "Microsoft 365-Gruppe"
#: includes/class-m365-login-settings.php:54
#: includes/class-m365-login-settings.php:55
msgid "Sign in with Microsoft"
msgstr "Login mit Microsoft"
#: includes/class-m365-login-settings.php:63
#: includes/class-m365-login-settings.php:64
msgid "or"
msgstr "oder"
#: includes/class-m365-login-settings.php:225 includes/class-m365-login-settings.php:530
#: includes/class-m365-login-settings.php:226 includes/class-m365-login-settings.php:540
msgid "The private key could not be encrypted. Is the OpenSSL extension available?"
msgstr "Der private Schlüssel konnte nicht verschlüsselt werden. Ist die OpenSSL-Erweiterung verfügbar?"
#: includes/class-m365-login-settings.php:476
#: includes/class-m365-login-settings.php:486
msgid "The tenant ID must be a GUID (e.g. 1a2b3c4d-…) or one of \"organizations\", \"common\", \"consumers\"."
msgstr "Die Tenant-ID muss eine GUID (z. B. 1a2b3c4d-…) oder einer der Werte „organizations“, „common“, „consumers“ sein."
#: includes/class-m365-login-settings.php:484
#: includes/class-m365-login-settings.php:494
msgid "The application (client) ID must be a GUID."
msgstr "Die Anwendungs-ID (Client) muss eine GUID sein."
#: includes/class-m365-login-settings.php:496
#: includes/class-m365-login-settings.php:506
msgid "The client secret contains invalid characters."
msgstr "Das Client Secret enthält ungültige Zeichen."
#: includes/class-m365-login-settings.php:500
#: includes/class-m365-login-settings.php:510
msgid "The client secret could not be encrypted. Is the OpenSSL extension available?"
msgstr "Das Client Secret konnte nicht verschlüsselt werden. Ist die OpenSSL-Erweiterung verfügbar?"
#: includes/class-m365-login-settings.php:520
#: includes/class-m365-login-settings.php:530
msgid "Please paste both the private key and the certificate."
msgstr "Bitte sowohl den privaten Schlüssel als auch das Zertifikat einfügen."
#: includes/class-m365-login-settings.php:522
#: includes/class-m365-login-settings.php:532
msgid "The pasted key or certificate is too large."
msgstr "Der eingefügte Schlüssel oder das Zertifikat ist zu groß."
#: includes/class-m365-login-settings.php:539
#: includes/class-m365-login-settings.php:549
msgid "Certificate authentication is selected but no certificate is stored yet. Generate one or paste your own; the Microsoft button stays hidden until then."
msgstr "Zertifikats-Authentifizierung ist ausgewählt, aber es ist noch kein Zertifikat gespeichert. Eines erzeugen oder ein eigenes einfügen; bis dahin bleibt der Microsoft-Button ausgeblendet."
#: includes/class-m365-login-settings.php:571
#: includes/class-m365-login-settings.php:582
msgid "The custom login page must be a URL on this site."
msgstr "Die eigene Login-Seite muss eine URL dieser Website sein."
#: includes/class-m365-login-settings.php:678
#: includes/class-m365-login-settings.php:689
msgid "User sync: \"Delete\" needs a user who receives the posts of deleted accounts. Until one is selected, accounts are deactivated instead."
msgstr "Benutzer-Sync: „Löschen“ braucht einen Benutzer, der die Beiträge gelöschter Konten übernimmt. Bis einer ausgewählt ist, werden Konten stattdessen deaktiviert."