Skip to content

A platform for community discussion. Free, open, simple.

DEV: Move discourse-microsoft-auth to core (#33570)

Jarek Radosz336d23f7e438
diff --git a/.github/labeler.yml b/.github/labeler.yml
index b6fa55c93ff..07d849cd416 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -34,6 +34,10 @@ discourse-apple-auth:
- changed-files:
- any-glob-to-any-file: plugins/discourse-apple-auth/**/*
+discourse-microsoft-auth:
+ - changed-files:
+ - any-glob-to-any-file: plugins/discourse-microsoft-auth/**/*
+
footnote:
- changed-files:
- any-glob-to-any-file: plugins/footnote/**/*
diff --git a/.gitignore b/.gitignore
index 33b36c249b2..b10bb67d2ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,6 +51,7 @@
!/plugins/footnote
!/plugins/discourse-reactions
!/plugins/discourse-apple-auth
+!/plugins/discourse-microsoft-auth
/plugins/*/auto_generated
/spec/fixtures/plugins/my_plugin/auto_generated
diff --git a/plugins/discourse-microsoft-auth/README.md b/plugins/discourse-microsoft-auth/README.md
new file mode 100644
index 00000000000..eb795f5e14a
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/README.md
@@ -0,0 +1,5 @@
+# Microsoft Login / Authentication Plugin
+
+A simple plugin that enables authentication via Microsoft.
+
+For more information, please see: https://meta.discourse.org/t/microsoft-authentication/51731
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.ar.yml b/plugins/discourse-microsoft-auth/config/locales/client.ar.yml
new file mode 100644
index 00000000000..b2c013572e3
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.ar.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ar:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "تسجيل الدخول باستخدام Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.be.yml b/plugins/discourse-microsoft-auth/config/locales/client.be.yml
new file mode 100644
index 00000000000..2ea77a0d350
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.be.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+be:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.bg.yml b/plugins/discourse-microsoft-auth/config/locales/client.bg.yml
new file mode 100644
index 00000000000..52333529d3c
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.bg.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bg:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.bs_BA.yml b/plugins/discourse-microsoft-auth/config/locales/client.bs_BA.yml
new file mode 100644
index 00000000000..828a7e65af8
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.bs_BA.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bs_BA:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.ca.yml b/plugins/discourse-microsoft-auth/config/locales/client.ca.yml
new file mode 100644
index 00000000000..ec737bc1a5b
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.ca.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ca:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.cs.yml b/plugins/discourse-microsoft-auth/config/locales/client.cs.yml
new file mode 100644
index 00000000000..1244ba3455c
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.cs.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+cs:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Přihlásit se přes Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.da.yml b/plugins/discourse-microsoft-auth/config/locales/client.da.yml
new file mode 100644
index 00000000000..f39c727c594
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.da.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+da:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.de.yml b/plugins/discourse-microsoft-auth/config/locales/client.de.yml
new file mode 100644
index 00000000000..48c7e693150
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.de.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+de:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Mit Microsoft anmelden"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.el.yml b/plugins/discourse-microsoft-auth/config/locales/client.el.yml
new file mode 100644
index 00000000000..d872d0ecc40
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.el.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+el:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.en.yml b/plugins/discourse-microsoft-auth/config/locales/client.en.yml
new file mode 100644
index 00000000000..9aeac7e1f2b
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.en.yml
@@ -0,0 +1,6 @@
+en:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Login with Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.en_GB.yml b/plugins/discourse-microsoft-auth/config/locales/client.en_GB.yml
new file mode 100644
index 00000000000..2d4fa180ec7
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.en_GB.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+en_GB:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.es.yml b/plugins/discourse-microsoft-auth/config/locales/client.es.yml
new file mode 100644
index 00000000000..a5bea388c3e
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.es.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+es:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Iniciar sesión con Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.et.yml b/plugins/discourse-microsoft-auth/config/locales/client.et.yml
new file mode 100644
index 00000000000..0ea0b6d554b
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.et.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+et:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.fa_IR.yml b/plugins/discourse-microsoft-auth/config/locales/client.fa_IR.yml
new file mode 100644
index 00000000000..9fca048118c
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.fa_IR.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fa_IR:
+ js:
+ login:
+ microsoft_office365:
+ name: "مایکروسافت"
+ title: "ورود با مایکروسافت"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.fi.yml b/plugins/discourse-microsoft-auth/config/locales/client.fi.yml
new file mode 100644
index 00000000000..9ee5c957108
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.fi.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fi:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Kirjaudu sisään Microsoft-tilillä"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.fr.yml b/plugins/discourse-microsoft-auth/config/locales/client.fr.yml
new file mode 100644
index 00000000000..3d52cbe9c60
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.fr.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fr:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Se connecter avec Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.gl.yml b/plugins/discourse-microsoft-auth/config/locales/client.gl.yml
new file mode 100644
index 00000000000..fb911ce1635
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.gl.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+gl:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.he.yml b/plugins/discourse-microsoft-auth/config/locales/client.he.yml
new file mode 100644
index 00000000000..e4db947f1f8
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.he.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+he:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "כניסה עם Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.hr.yml b/plugins/discourse-microsoft-auth/config/locales/client.hr.yml
new file mode 100644
index 00000000000..93343ce6e19
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.hr.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hr:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.hu.yml b/plugins/discourse-microsoft-auth/config/locales/client.hu.yml
new file mode 100644
index 00000000000..76b6e9d8bcb
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.hu.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hu:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.hy.yml b/plugins/discourse-microsoft-auth/config/locales/client.hy.yml
new file mode 100644
index 00000000000..cb18f64d356
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.hy.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hy:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.id.yml b/plugins/discourse-microsoft-auth/config/locales/client.id.yml
new file mode 100644
index 00000000000..596e36b2e13
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.id.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+id:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.it.yml b/plugins/discourse-microsoft-auth/config/locales/client.it.yml
new file mode 100644
index 00000000000..3582aff3d87
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.it.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+it:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Accedi con Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.ja.yml b/plugins/discourse-microsoft-auth/config/locales/client.ja.yml
new file mode 100644
index 00000000000..0256417cc24
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.ja.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ja:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Microsoft でログイン"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.ko.yml b/plugins/discourse-microsoft-auth/config/locales/client.ko.yml
new file mode 100644
index 00000000000..18dd77fd3ec
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.ko.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ko:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.lt.yml b/plugins/discourse-microsoft-auth/config/locales/client.lt.yml
new file mode 100644
index 00000000000..16bb19758dc
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.lt.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lt:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.lv.yml b/plugins/discourse-microsoft-auth/config/locales/client.lv.yml
new file mode 100644
index 00000000000..59e0ef6f4ed
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.lv.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lv:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.nb_NO.yml b/plugins/discourse-microsoft-auth/config/locales/client.nb_NO.yml
new file mode 100644
index 00000000000..2e2224d1472
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.nb_NO.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nb_NO:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.nl.yml b/plugins/discourse-microsoft-auth/config/locales/client.nl.yml
new file mode 100644
index 00000000000..324b59b01a9
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.nl.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nl:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Aanmelden met Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.pl_PL.yml b/plugins/discourse-microsoft-auth/config/locales/client.pl_PL.yml
new file mode 100644
index 00000000000..523acd030d4
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.pl_PL.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pl_PL:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Zaloguj się przez Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.pt.yml b/plugins/discourse-microsoft-auth/config/locales/client.pt.yml
new file mode 100644
index 00000000000..298ba523c1d
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.pt.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.pt_BR.yml b/plugins/discourse-microsoft-auth/config/locales/client.pt_BR.yml
new file mode 100644
index 00000000000..c63829ed11e
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.pt_BR.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt_BR:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Entrar com Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.ro.yml b/plugins/discourse-microsoft-auth/config/locales/client.ro.yml
new file mode 100644
index 00000000000..08a77f812ee
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.ro.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ro:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.ru.yml b/plugins/discourse-microsoft-auth/config/locales/client.ru.yml
new file mode 100644
index 00000000000..7fc0017d58b
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.ru.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ru:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Вход через Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.sk.yml b/plugins/discourse-microsoft-auth/config/locales/client.sk.yml
new file mode 100644
index 00000000000..6f815624081
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.sk.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sk:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.sl.yml b/plugins/discourse-microsoft-auth/config/locales/client.sl.yml
new file mode 100644
index 00000000000..23489a48b1f
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.sl.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sl:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.sq.yml b/plugins/discourse-microsoft-auth/config/locales/client.sq.yml
new file mode 100644
index 00000000000..7f051b7a7cf
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.sq.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sq:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.sr.yml b/plugins/discourse-microsoft-auth/config/locales/client.sr.yml
new file mode 100644
index 00000000000..88d63d6ae1a
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.sr.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sr:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.sv.yml b/plugins/discourse-microsoft-auth/config/locales/client.sv.yml
new file mode 100644
index 00000000000..508923a7857
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.sv.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sv:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Logga in med Microsoft"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.sw.yml b/plugins/discourse-microsoft-auth/config/locales/client.sw.yml
new file mode 100644
index 00000000000..0d7cdd075bf
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.sw.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sw:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.te.yml b/plugins/discourse-microsoft-auth/config/locales/client.te.yml
new file mode 100644
index 00000000000..03967bdbb07
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.te.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+te:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.th.yml b/plugins/discourse-microsoft-auth/config/locales/client.th.yml
new file mode 100644
index 00000000000..7de85ff91c4
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.th.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+th:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.tr_TR.yml b/plugins/discourse-microsoft-auth/config/locales/client.tr_TR.yml
new file mode 100644
index 00000000000..8f79a2743fd
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.tr_TR.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+tr_TR:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "Microsoft ile giriş yapın"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.ug.yml b/plugins/discourse-microsoft-auth/config/locales/client.ug.yml
new file mode 100644
index 00000000000..a6bf0185ae2
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.ug.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ug:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.uk.yml b/plugins/discourse-microsoft-auth/config/locales/client.uk.yml
new file mode 100644
index 00000000000..f1390545d1d
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.uk.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+uk:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.ur.yml b/plugins/discourse-microsoft-auth/config/locales/client.ur.yml
new file mode 100644
index 00000000000..b4a9c21ee2f
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.ur.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ur:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.vi.yml b/plugins/discourse-microsoft-auth/config/locales/client.vi.yml
new file mode 100644
index 00000000000..f629dcf5329
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.vi.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+vi:
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.zh_CN.yml b/plugins/discourse-microsoft-auth/config/locales/client.zh_CN.yml
new file mode 100644
index 00000000000..19feff407fa
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.zh_CN.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_CN:
+ js:
+ login:
+ microsoft_office365:
+ name: "Microsoft"
+ title: "使用 Microsoft 登录"
diff --git a/plugins/discourse-microsoft-auth/config/locales/client.zh_TW.yml b/plugins/discourse-microsoft-auth/config/locales/client.zh_TW.yml
new file mode 100644
index 00000000000..7e15fab0018
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/client.zh_TW.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_TW:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.ar.yml b/plugins/discourse-microsoft-auth/config/locales/server.ar.yml
new file mode 100644
index 00000000000..053534a1943
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.ar.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ar:
+ site_settings:
+ microsoft_auth_enabled: "هل تريد السماح للمستخدمين بالمصادقة باستخدام Microsoft؟"
+ microsoft_auth_client_id: 'معرِّف تطبيق Microsoft/معرِّف العميل (ليس المعرِّف السري) - للإعداد، انتقل إلى <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "كلمة مرور Microsoft السرية (استخدم القيمة، وليس المعرِّف السري)"
+ microsoft_auth_email_verified: "معاملة جميع عناوين البريد الإلكتروني من Microsoft على أنها تم التحقق منها افتراضيًا. تحذير: لا تقم بتفعيل هذا الإعداد إلا إذا كنت متأكدًا من أن جميع المستخدمين لديهم عناوين بريد إلكتروني تم التحقق منها."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.be.yml b/plugins/discourse-microsoft-auth/config/locales/server.be.yml
new file mode 100644
index 00000000000..2ea77a0d350
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.be.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+be:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.bg.yml b/plugins/discourse-microsoft-auth/config/locales/server.bg.yml
new file mode 100644
index 00000000000..52333529d3c
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.bg.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bg:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.bs_BA.yml b/plugins/discourse-microsoft-auth/config/locales/server.bs_BA.yml
new file mode 100644
index 00000000000..828a7e65af8
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.bs_BA.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bs_BA:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.ca.yml b/plugins/discourse-microsoft-auth/config/locales/server.ca.yml
new file mode 100644
index 00000000000..ec737bc1a5b
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.ca.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ca:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.cs.yml b/plugins/discourse-microsoft-auth/config/locales/server.cs.yml
new file mode 100644
index 00000000000..7cffe118ab9
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.cs.yml
@@ -0,0 +1,13 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+cs:
+ site_settings:
+ microsoft_auth_enabled: "Povolit uživatelům ověřování pomocí služby Microsoft?"
+ microsoft_auth_client_id: 'Microsoft App ID/Client ID (NE Secret ID) – pro nastavení navštivte <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Tajné heslo společnosti Microsoft (použijte Value, nikoliv Secret ID)"
+ microsoft_auth_email_verified: "Ve výchozím nastavení zacházet se všemi e-maily společnosti Microsoft jako s ověřenými. VAROVÁNÍ: Tuto možnost povolte pouze v případě, že jste si jisti, že všichni vaši uživatelé mají ověřené e-maily."
+ microsoft_auth_tenant_id: 'Microsoft Tenant ID (běžné je standardní, je POVINNÉ pro všechny případy kromě jednoho tenanta) – ID najdete na <a href="https://portal.azure.com/#view/Microsoft_AAD_IAM/TenantProperties.ReactView">https://portal.azure.com/#view/Microsoft_AAD_IAM/TenantProperties.ReactView</a>'
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.da.yml b/plugins/discourse-microsoft-auth/config/locales/server.da.yml
new file mode 100644
index 00000000000..f39c727c594
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.da.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+da:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.de.yml b/plugins/discourse-microsoft-auth/config/locales/server.de.yml
new file mode 100644
index 00000000000..20519a8b507
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.de.yml
@@ -0,0 +1,13 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+de:
+ site_settings:
+ microsoft_auth_enabled: "Benutzern erlauben, sich mit Microsoft zu authentifizieren?"
+ microsoft_auth_client_id: 'Microsoft-App-ID/-Client-ID (NICHT die Secret-ID) – besuche zur Einrichtung <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Microsoft-Secret-Passwort (verwende den Wert, NICHT die Secret-ID)"
+ microsoft_auth_email_verified: "Alle Microsoft-E-Mails standardmäßig als verifiziert behandeln. WARNUNG: Aktiviere diese Option nur, wenn du sicher bist, dass alle deine Benutzer verifizierte E-Mails haben."
+ microsoft_auth_tenant_id: 'Microsoft Tenant ID (common ist Standard, ist ein MUSS für alle Fälle außer Single Tenant) - um die ID zu finden, besuche <a href="https://portal.azure.com/#view/Microsoft_AAD_IAM/TenantProperties.ReactView">https://portal.azure.com/#view/Microsoft_AAD_IAM/TenantProperties.ReactView</a>'
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.el.yml b/plugins/discourse-microsoft-auth/config/locales/server.el.yml
new file mode 100644
index 00000000000..d872d0ecc40
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.el.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+el:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.en.yml b/plugins/discourse-microsoft-auth/config/locales/server.en.yml
new file mode 100644
index 00000000000..6cb9774c18a
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.en.yml
@@ -0,0 +1,7 @@
+en:
+ site_settings:
+ microsoft_auth_enabled: "Allow users to authenticate using Microsoft?"
+ microsoft_auth_client_id: 'Microsoft App ID/Client ID (NOT the Secret ID) - to setup visit <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Microsoft Secret Password (use the Value, NOT the Secret ID)"
+ microsoft_auth_email_verified: "Treat all Microsoft emails as verified by default. WARNING: Only enable this if you are sure that all your users have verified emails."
+ microsoft_auth_tenant_id: 'Microsoft Tenant ID (common is standard, is a MUST for all cases except Single Tenant) - to find the ID visit <a href="https://portal.azure.com/#view/Microsoft_AAD_IAM/TenantProperties.ReactView">https://portal.azure.com/#view/Microsoft_AAD_IAM/TenantProperties.ReactView</a>'
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.en_GB.yml b/plugins/discourse-microsoft-auth/config/locales/server.en_GB.yml
new file mode 100644
index 00000000000..2d4fa180ec7
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.en_GB.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+en_GB:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.es.yml b/plugins/discourse-microsoft-auth/config/locales/server.es.yml
new file mode 100644
index 00000000000..ca454a70bb6
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.es.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+es:
+ site_settings:
+ microsoft_auth_enabled: "¿Permitir a los usuarios la autenticación mediante Microsoft?"
+ microsoft_auth_client_id: 'ID de aplicación/ID de cliente de Microsoft (NO el ID de secreto) - para configurar, visita <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Contraseña secreta de Microsoft (utiliza el Valor, NO el ID de secreto)"
+ microsoft_auth_email_verified: "Tratar todos los correos electrónicos de Microsoft como verificados por defecto. ADVERTENCIA: Activa esta opción solo si estás seguro de que todos tus usuarios tienen correos electrónicos verificados."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.et.yml b/plugins/discourse-microsoft-auth/config/locales/server.et.yml
new file mode 100644
index 00000000000..0ea0b6d554b
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.et.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+et:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.fa_IR.yml b/plugins/discourse-microsoft-auth/config/locales/server.fa_IR.yml
new file mode 100644
index 00000000000..d15ff37b7de
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.fa_IR.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fa_IR:
+ site_settings:
+ microsoft_auth_enabled: "به کاربران اجازه می‌دهید با استفاده از مایکروسافت احراز هویت کنند؟"
+ microsoft_auth_email_verified: "تمام ایمیل‌های مایکروسافت را به صورت پیش‌فرض تایید شده در نظر بگیرید. \nاخطار: این را فقط در صورتی فعال کنید که مطمئن باشید همه کاربران شما ایمیل‌های تایید شده دارند."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.fi.yml b/plugins/discourse-microsoft-auth/config/locales/server.fi.yml
new file mode 100644
index 00000000000..04d777a2790
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.fi.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fi:
+ site_settings:
+ microsoft_auth_enabled: "Sallitaanko käyttäjien tehdä todennus Microsoftilla?"
+ microsoft_auth_client_id: 'Microsoft App ID/Client ID (EI Secret ID) – määritä osoitteessa <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Microsoft Secret Password (käytä arvoa, EI Secret ID:tä)"
+ microsoft_auth_email_verified: "Käsittele kaikkia Microsoft-sähköpostiosoitteita oletusarvoisesti vahvistettuina. VAROITUS: käytä tätä vain, jos kaikki käyttäjäsi ovat varmasti vahvistaneet osoitteensa."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.fr.yml b/plugins/discourse-microsoft-auth/config/locales/server.fr.yml
new file mode 100644
index 00000000000..a2cde6bf73d
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.fr.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fr:
+ site_settings:
+ microsoft_auth_enabled: "Permettre aux utilisateurs de s'authentifier via Microsoft ?"
+ microsoft_auth_client_id: 'App ID/ID de client Microsoft (il ne s''agit PAS de l''ID secret). Pour le configurer, visitez <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Mot de passe secret Microsoft (utilisez la valeur, PAS l'ID secret)"
+ microsoft_auth_email_verified: "Traitez tous les e-mails Microsoft comme vérifiés par défaut. AVERTISSEMENT : activez cette option uniquement si vous êtes sûr(e) que tous vos utilisateurs ont vérifié leurs adresses e-mail."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.gl.yml b/plugins/discourse-microsoft-auth/config/locales/server.gl.yml
new file mode 100644
index 00000000000..fb911ce1635
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.gl.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+gl:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.he.yml b/plugins/discourse-microsoft-auth/config/locales/server.he.yml
new file mode 100644
index 00000000000..baf8d221085
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.he.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+he:
+ site_settings:
+ microsoft_auth_enabled: "לאפשר למשתמשים לעבור אימות דרך Microsoft?"
+ microsoft_auth_client_id: 'מזהה יישום/לקוח של Microsoft (לא המזהה הסודי) - כדי להקים נא לגשת אל <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "סיסמה סודית ב־Microsoft (יש להשתמש בערך, לא המזהה הסודי)"
+ microsoft_auth_email_verified: "להתייחס לכל הודעות הדוא״ל מ־Microsoft כמאומתות כברירת מחדל. אזהרה: יש להפעיל את זה רק אם לכל המשתמשים שלך יש כתובות דוא״ל מאומתות."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.hr.yml b/plugins/discourse-microsoft-auth/config/locales/server.hr.yml
new file mode 100644
index 00000000000..93343ce6e19
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.hr.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hr:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.hu.yml b/plugins/discourse-microsoft-auth/config/locales/server.hu.yml
new file mode 100644
index 00000000000..76b6e9d8bcb
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.hu.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hu:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.hy.yml b/plugins/discourse-microsoft-auth/config/locales/server.hy.yml
new file mode 100644
index 00000000000..cb18f64d356
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.hy.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hy:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.id.yml b/plugins/discourse-microsoft-auth/config/locales/server.id.yml
new file mode 100644
index 00000000000..596e36b2e13
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.id.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+id:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.it.yml b/plugins/discourse-microsoft-auth/config/locales/server.it.yml
new file mode 100644
index 00000000000..3badc0d1e2a
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.it.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+it:
+ site_settings:
+ microsoft_auth_enabled: "Consentire agli utenti di autenticarsi utilizzando Microsoft?"
+ microsoft_auth_client_id: 'Microsoft App ID/Client ID (NON il Secret ID): per la configurazione, visita <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Microsoft Secret Password (usa il valore, NON il Secret ID)"
+ microsoft_auth_email_verified: "Tratta tutte le e-mail Microsoft come verificate per impostazione predefinita. ATTENZIONE: abilita solo se hai certezza che tutti i tuoi utenti abbiano e-mail verificate."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.ja.yml b/plugins/discourse-microsoft-auth/config/locales/server.ja.yml
new file mode 100644
index 00000000000..003d0e11ad7
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.ja.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ja:
+ site_settings:
+ microsoft_auth_enabled: "Microsoft を使ったユーザーの認証を許可しますか?"
+ microsoft_auth_client_id: 'Microsoft アプリ ID/クライアント ID (シークレット ID ではありません) - <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a> でセットアップしてください'
+ microsoft_auth_client_secret: "Microsoft シークレットパスワード (シークレット ID ではなく値を使用します)"
+ microsoft_auth_email_verified: "すべての Microsoft メールをデフォルトで検証済みとして扱います。警告: すべてのユーザーのメールアドレスが検証済みである場合にのみ、これを有効にしてください。"
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.ko.yml b/plugins/discourse-microsoft-auth/config/locales/server.ko.yml
new file mode 100644
index 00000000000..18dd77fd3ec
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.ko.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ko:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.lt.yml b/plugins/discourse-microsoft-auth/config/locales/server.lt.yml
new file mode 100644
index 00000000000..16bb19758dc
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.lt.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lt:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.lv.yml b/plugins/discourse-microsoft-auth/config/locales/server.lv.yml
new file mode 100644
index 00000000000..59e0ef6f4ed
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.lv.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lv:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.nb_NO.yml b/plugins/discourse-microsoft-auth/config/locales/server.nb_NO.yml
new file mode 100644
index 00000000000..2e2224d1472
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.nb_NO.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nb_NO:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.nl.yml b/plugins/discourse-microsoft-auth/config/locales/server.nl.yml
new file mode 100644
index 00000000000..8dd9197e803
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.nl.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nl:
+ site_settings:
+ microsoft_auth_enabled: "Gebruikers toestaan zich aan te melden met Microsoft?"
+ microsoft_auth_client_id: 'Microsoft app-ID/client-ID (NIET de geheime ID) - ga om er een in te stellen naar <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Microsoft geheim wachtwoord (gebruik de waarde, NIET de geheime ID)"
+ microsoft_auth_email_verified: "Behandel alle Microsoft-e-mails standaard als geverifieerd. WAARSCHUWING: schakel dit alleen in als je zeker weet dat al je gebruikers geverifieerde e-mailadressen hebben."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.pl_PL.yml b/plugins/discourse-microsoft-auth/config/locales/server.pl_PL.yml
new file mode 100644
index 00000000000..b8c3086a94c
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.pl_PL.yml
@@ -0,0 +1,11 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pl_PL:
+ site_settings:
+ microsoft_auth_enabled: "Zezwolić użytkownikom na uwierzytelnianie za pomocą Microsoft?"
+ microsoft_auth_client_id: 'Microsoft App ID/Client ID (NIE Secret ID) - aby skonfigurować odwiedź <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Tajne hasło Microsoft (użyj wartości, a NIE tajnego identyfikatora)"
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.pt.yml b/plugins/discourse-microsoft-auth/config/locales/server.pt.yml
new file mode 100644
index 00000000000..298ba523c1d
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.pt.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.pt_BR.yml b/plugins/discourse-microsoft-auth/config/locales/server.pt_BR.yml
new file mode 100644
index 00000000000..c2739666994
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.pt_BR.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt_BR:
+ site_settings:
+ microsoft_auth_enabled: "Permitir que os(as) usuários(as) façam autenticação via Microsoft?"
+ microsoft_auth_client_id: 'ID do aplicativo da Microsoft/ID de Cliente (NÃO é o ID Secreto). Para configurar, acesse <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Senha secreta da Microsoft (use o valor, não o ID Secreto)"
+ microsoft_auth_email_verified: "Trate todos os e-mails da Microsoft como verificados por padrão. AVISO: ative isto apenas se você tiver certeza de que os(as) usuários(as) têm e-mails verificados."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.ro.yml b/plugins/discourse-microsoft-auth/config/locales/server.ro.yml
new file mode 100644
index 00000000000..08a77f812ee
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.ro.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ro:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.ru.yml b/plugins/discourse-microsoft-auth/config/locales/server.ru.yml
new file mode 100644
index 00000000000..7fe4034a05f
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.ru.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ru:
+ site_settings:
+ microsoft_auth_enabled: "Разрешать пользователям аутентифицироваться через Microsoft?"
+ microsoft_auth_client_id: 'Microsoft App ID/Client ID (обратите внимание: не Secret ID) — для настройки посетите <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Секретный пароль Microsoft (используйте Value, а НЕ Secret ID)"
+ microsoft_auth_email_verified: "Считает все адреса эл. почты Microsoft проверенными по умолчанию. ВНИМАНИЕ: включайте этот параметр только в том случае, если вы уверены, что все ваши пользователи подтвердили адреса эл. почты."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.sk.yml b/plugins/discourse-microsoft-auth/config/locales/server.sk.yml
new file mode 100644
index 00000000000..6f815624081
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.sk.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sk:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.sl.yml b/plugins/discourse-microsoft-auth/config/locales/server.sl.yml
new file mode 100644
index 00000000000..23489a48b1f
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.sl.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sl:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.sq.yml b/plugins/discourse-microsoft-auth/config/locales/server.sq.yml
new file mode 100644
index 00000000000..7f051b7a7cf
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.sq.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sq:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.sr.yml b/plugins/discourse-microsoft-auth/config/locales/server.sr.yml
new file mode 100644
index 00000000000..88d63d6ae1a
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.sr.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sr:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.sv.yml b/plugins/discourse-microsoft-auth/config/locales/server.sv.yml
new file mode 100644
index 00000000000..9df42ad9f8e
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.sv.yml
@@ -0,0 +1,9 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sv:
+ site_settings:
+ microsoft_auth_enabled: "Tillåta användare att autentisera genom Microsoft?"
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.sw.yml b/plugins/discourse-microsoft-auth/config/locales/server.sw.yml
new file mode 100644
index 00000000000..0d7cdd075bf
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.sw.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sw:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.te.yml b/plugins/discourse-microsoft-auth/config/locales/server.te.yml
new file mode 100644
index 00000000000..03967bdbb07
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.te.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+te:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.th.yml b/plugins/discourse-microsoft-auth/config/locales/server.th.yml
new file mode 100644
index 00000000000..7de85ff91c4
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.th.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+th:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.tr_TR.yml b/plugins/discourse-microsoft-auth/config/locales/server.tr_TR.yml
new file mode 100644
index 00000000000..0bde16599f1
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.tr_TR.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+tr_TR:
+ site_settings:
+ microsoft_auth_enabled: "Kullanıcıların Microsoft kullanarak kimlik doğrulaması yapmasına izin verilsin mi?"
+ microsoft_auth_client_id: 'Microsoft Uygulama Kimliği/İstemci Kimliği (Gizli Kimlik DEĞİL) - Kurmak için şu adresi ziyaret edin: <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>)'
+ microsoft_auth_client_secret: "Microsoft Gizli Şifre (Değeri kullanın, Gizli Kimliği DEĞİL)"
+ microsoft_auth_email_verified: "Tüm Microsoft e-postalarına varsayılan olarak doğrulanmış gibi davranın. UYARI: Bunu yalnızca tüm kullanıcılarınızın e-posta adreslerinin doğrulandığından eminseniz etkinleştirin."
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.ug.yml b/plugins/discourse-microsoft-auth/config/locales/server.ug.yml
new file mode 100644
index 00000000000..a6bf0185ae2
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.ug.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ug:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.uk.yml b/plugins/discourse-microsoft-auth/config/locales/server.uk.yml
new file mode 100644
index 00000000000..f1390545d1d
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.uk.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+uk:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.ur.yml b/plugins/discourse-microsoft-auth/config/locales/server.ur.yml
new file mode 100644
index 00000000000..b4a9c21ee2f
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.ur.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ur:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.vi.yml b/plugins/discourse-microsoft-auth/config/locales/server.vi.yml
new file mode 100644
index 00000000000..f629dcf5329
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.vi.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+vi:
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.zh_CN.yml b/plugins/discourse-microsoft-auth/config/locales/server.zh_CN.yml
new file mode 100644
index 00000000000..7aca7373d4c
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.zh_CN.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_CN:
+ site_settings:
+ microsoft_auth_enabled: "允许用户使用 Microsoft 进行身份验证?"
+ microsoft_auth_client_id: 'Microsoft 应用 ID/客户端 ID(非秘密 ID)– 要进行设置,请访问 <a href="https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade">https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade</a>'
+ microsoft_auth_client_secret: "Microsoft 秘密密码(使用值,而非秘密 ID)"
+ microsoft_auth_email_verified: "默认将所有 Microsoft 电子邮件视为已验证。警告:仅当您确定所有用户都已验证电子邮件时才启用此功能。"
diff --git a/plugins/discourse-microsoft-auth/config/locales/server.zh_TW.yml b/plugins/discourse-microsoft-auth/config/locales/server.zh_TW.yml
new file mode 100644
index 00000000000..7e15fab0018
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/locales/server.zh_TW.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_TW:
diff --git a/plugins/discourse-microsoft-auth/config/settings.yml b/plugins/discourse-microsoft-auth/config/settings.yml
new file mode 100644
index 00000000000..5c342d3c89c
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/config/settings.yml
@@ -0,0 +1,15 @@
+plugins:
+ microsoft_auth_enabled:
+ client: true
+ default: false
+ microsoft_auth_client_id:
+ client: false
+ default: ""
+ microsoft_auth_client_secret:
+ client: false
+ default: ""
+ microsoft_auth_email_verified:
+ default: false
+ microsoft_auth_tenant_id:
+ client: false
+ default: "common"
diff --git a/plugins/discourse-microsoft-auth/db/migrate/20211202134547_migrate_office365_user_info.rb b/plugins/discourse-microsoft-auth/db/migrate/20211202134547_migrate_office365_user_info.rb
new file mode 100644
index 00000000000..f1371448f06
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/db/migrate/20211202134547_migrate_office365_user_info.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+class MigrateOffice365UserInfo < ActiveRecord::Migration[6.1]
+ def up
+ execute <<~SQL
+ INSERT INTO user_associated_accounts (
+ provider_name,
+ provider_uid,
+ user_id,
+ info,
+ last_used,
+ created_at,
+ updated_at
+ ) SELECT
+ 'microsoft_office365',
+ uid,
+ user_id,
+ json_build_object('email', email, 'name', name),
+ updated_at,
+ created_at,
+ updated_at
+ FROM oauth2_user_infos
+ WHERE provider = 'microsoft_office365'
+ ON CONFLICT DO NOTHING
+ SQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/db/migrate/20211202140128_rename_office365_to_microsoft.rb b/plugins/discourse-microsoft-auth/db/migrate/20211202140128_rename_office365_to_microsoft.rb
new file mode 100644
index 00000000000..7b34d2531df
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/db/migrate/20211202140128_rename_office365_to_microsoft.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+class RenameOffice365ToMicrosoft < ActiveRecord::Migration[6.1]
+ CHANGES = [
+ %w[office365_enabled microsoft_auth_enabled],
+ %w[office365_client_id microsoft_auth_client_id],
+ %w[office365_secret microsoft_auth_client_secret],
+ ]
+
+ def up
+ CHANGES.each { |old, new| DB.exec(<<~SQL, old_name: old, new_name: new) }
+ INSERT INTO site_settings (name, data_type, value, created_at, updated_at)
+ SELECT :new_name, data_type, value, created_at, updated_at
+ FROM site_settings
+ WHERE name = :old_name
+ SQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/db/migrate/20211202141030_remove_old_office365_site_settings.rb b/plugins/discourse-microsoft-auth/db/migrate/20211202141030_remove_old_office365_site_settings.rb
new file mode 100644
index 00000000000..1e3aa107f9a
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/db/migrate/20211202141030_remove_old_office365_site_settings.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+class RemoveOldOffice365SiteSettings < ActiveRecord::Migration[6.1]
+ def up
+ execute "DELETE FROM site_settings WHERE name IN ('office365_enabled', 'office365_client_id', 'office365_secret')"
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/db/migrate/20211230152430_remove_old_office365_data.rb b/plugins/discourse-microsoft-auth/db/migrate/20211230152430_remove_old_office365_data.rb
new file mode 100644
index 00000000000..dfaf7044e17
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/db/migrate/20211230152430_remove_old_office365_data.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+class RemoveOldOffice365Data < ActiveRecord::Migration[6.1]
+ def up
+ execute "DELETE FROM oauth2_user_infos WHERE provider = 'microsoft_office365'"
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/lib/microsoft_auth_revoker.rb b/plugins/discourse-microsoft-auth/lib/microsoft_auth_revoker.rb
new file mode 100644
index 00000000000..d17ff693ede
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/lib/microsoft_auth_revoker.rb
@@ -0,0 +1,49 @@
+# frozen_string_literal: true
+
+class MicrosoftAuthRevoker
+ def self.revoke
+ # Deactive users using microsoft as an authentication provider
+ DB.exec <<~SQL
+ UPDATE users SET active = false
+ WHERE users.id IN (#{microsoft_user_associated_accounts_sql})
+ SQL
+
+ # Log out all users using microsoft as an authentication provider
+ log_out_users
+
+ # Revoke user API keys for users using microsoft as an authentication provider
+ DB.exec <<~SQL
+ UPDATE user_api_keys
+ SET revoked_at = NOW()
+ WHERE user_id IN (#{microsoft_user_associated_accounts_sql})
+ SQL
+
+ # Revoke API keys that are created by users using microsoft as an authentication provider
+ DB.exec <<~SQL
+ UPDATE api_keys
+ SET revoked_at = NOW()
+ WHERE created_by_id IN (#{microsoft_user_associated_accounts_sql})
+ SQL
+
+ # Remove microsoft as an authentication provider for all users
+ DB.exec <<~SQL
+ DELETE FROM user_associated_accounts
+ WHERE provider_name = 'microsoft_office365'
+ SQL
+ end
+
+ def self.log_out_users
+ DB.exec <<~SQL
+ DELETE FROM user_auth_tokens
+ WHERE user_id IN (#{microsoft_user_associated_accounts_sql})
+ SQL
+ end
+
+ def self.microsoft_user_associated_accounts_sql
+ <<~SQL
+ SELECT user_id
+ FROM user_associated_accounts
+ WHERE provider_name = 'microsoft_office365'
+ SQL
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/lib/microsoft_authenticator.rb b/plugins/discourse-microsoft-auth/lib/microsoft_authenticator.rb
new file mode 100644
index 00000000000..ea7755d843d
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/lib/microsoft_authenticator.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+class MicrosoftAuthenticator < ::Auth::ManagedAuthenticator
+ def name
+ "microsoft_office365"
+ end
+
+ def register_middleware(omniauth)
+ omniauth.provider :microsoft_office365,
+ setup:
+ lambda { |env|
+ strategy = env["omniauth.strategy"]
+ strategy.options[:client_id] = SiteSetting.microsoft_auth_client_id
+ strategy.options[
+ :client_secret
+ ] = SiteSetting.microsoft_auth_client_secret
+ strategy.options[:client_options] = {
+ site: "https://login.microsoftonline.com",
+ authorize_url:
+ "/#{SiteSetting.microsoft_auth_tenant_id}/oauth2/v2.0/authorize",
+ token_url: "/#{SiteSetting.microsoft_auth_tenant_id}/oauth2/v2.0/token",
+ }
+ }
+ end
+
+ def enabled?
+ SiteSetting.microsoft_auth_enabled
+ end
+
+ def primary_email_verified?(auth_token)
+ SiteSetting.microsoft_auth_email_verified
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/lib/omniauth-microsoft365.rb b/plugins/discourse-microsoft-auth/lib/omniauth-microsoft365.rb
new file mode 100644
index 00000000000..16d1000d5c0
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/lib/omniauth-microsoft365.rb
@@ -0,0 +1,44 @@
+# frozen_string_literal: true
+
+require "omniauth/strategies/oauth2"
+
+module OmniAuth
+ module Strategies
+ class MicrosoftOffice365 < OmniAuth::Strategies::OAuth2
+ option :name, :microsoft_office365
+
+ DEFAULT_SCOPE = "openid email profile https://graph.microsoft.com/User.Read"
+
+ option :authorize_options, [:scope]
+
+ uid { raw_info["id"] }
+
+ info do
+ {
+ name: raw_info["displayName"] || raw_info["userPrincipalName"],
+ email: raw_info["mail"] || raw_info["userPrincipalName"],
+ }
+ end
+
+ extra { { "raw_info" => raw_info } }
+
+ def raw_info
+ @raw_info ||= access_token.get("https://graph.microsoft.com/v1.0/me").parsed
+ end
+
+ def authorize_params
+ super.tap do |params|
+ %w[display score auth_type].each do |v|
+ params[v.to_sym] = request.params[v] if request.params[v]
+ end
+
+ params[:scope] ||= DEFAULT_SCOPE
+ end
+ end
+
+ def callback_url
+ full_host + script_name + callback_path
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/lib/tasks/microsoft_auth.rake b/plugins/discourse-microsoft-auth/lib/tasks/microsoft_auth.rake
new file mode 100644
index 00000000000..0d959be6b40
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/lib/tasks/microsoft_auth.rake
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+require_relative "../microsoft_auth_revoker"
+
+desc <<~DESC
+A rake task to remove microsoft as an authentication provider, log out, deactivate and remove all API keys for all
+users accounts that have used Microsoft as an authentication provider.
+DESC
+task "microsoft_auth:revoke" => :environment do
+ MicrosoftAuthRevoker.revoke
+end
+
+task "microsoft_auth:log_out_users" => :environment do
+ MicrosoftAuthRevoker.log_out_users
+end
diff --git a/plugins/discourse-microsoft-auth/plugin.rb b/plugins/discourse-microsoft-auth/plugin.rb
new file mode 100644
index 00000000000..6d48587bd3e
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/plugin.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# name: discourse-microsoft-auth
+# about: Enable Login via Microsoft Identity Platform (Office 365 / Microsoft 365 Accounts)
+# meta_topic_id: 51731
+# version: 2.0
+# authors: Matthew Wilkin
+# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-microsoft-auth
+
+require_relative "lib/omniauth-microsoft365"
+require_relative "lib/microsoft_authenticator"
+
+enabled_site_setting :microsoft_auth_enabled
+
+register_svg_icon "fab-microsoft"
+
+auth_provider authenticator: MicrosoftAuthenticator.new, icon: "fab-microsoft"
diff --git a/plugins/discourse-microsoft-auth/screenshot-admin-settings.png b/plugins/discourse-microsoft-auth/screenshot-admin-settings.png
new file mode 100644
index 00000000000..1134f8b04db
Binary files /dev/null and b/plugins/discourse-microsoft-auth/screenshot-admin-settings.png differ
diff --git a/plugins/discourse-microsoft-auth/screenshot-login-screen.png b/plugins/discourse-microsoft-auth/screenshot-login-screen.png
new file mode 100644
index 00000000000..ef7097d6486
Binary files /dev/null and b/plugins/discourse-microsoft-auth/screenshot-login-screen.png differ
diff --git a/plugins/discourse-microsoft-auth/spec/integration/microsoft_auth_spec.rb b/plugins/discourse-microsoft-auth/spec/integration/microsoft_auth_spec.rb
new file mode 100644
index 00000000000..721bb6c7416
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/spec/integration/microsoft_auth_spec.rb
@@ -0,0 +1,125 @@
+# frozen_string_literal: true
+
+describe "Microsoft OAuth2" do
+ let(:access_token) { "microsoft_access_token_448" }
+ let(:client_id) { "abcdef11223344" }
+ let(:client_secret) { "adddcccdddd99922" }
+ let(:temp_code) { "microsoft_temp_code_544254" }
+
+ fab!(:user1) { Fabricate(:user) }
+
+ def setup_ms_emails_stub(email:)
+ stub_request(:get, "https://graph.microsoft.com/v1.0/me").with(
+ headers: {
+ "Authorization" => "Bearer #{access_token}",
+ },
+ ).to_return(
+ status: 200,
+ body:
+ JSON.dump(
+ businessPhones: ["+1 425 555 0109"],
+ displayName: "Adele Vance",
+ givenName: "Adele",
+ jobTitle: "Retail Manager",
+ mail: email,
+ mobilePhone: "+1 425 555 0109",
+ officeLocation: "18/2111",
+ preferredLanguage: "en-US",
+ surname: "Vance",
+ userPrincipalName: email,
+ id: "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
+ ),
+ headers: {
+ "Content-Type" => "application/json",
+ },
+ )
+ end
+
+ before do
+ SiteSetting.microsoft_auth_enabled = true
+ SiteSetting.microsoft_auth_client_id = client_id
+ SiteSetting.microsoft_auth_client_secret = client_secret
+
+ stub_request(:post, "https://login.microsoftonline.com/common/oauth2/v2.0/token").with(
+ body:
+ hash_including(
+ "client_id" => client_id,
+ "client_secret" => client_secret,
+ "code" => temp_code,
+ "grant_type" => "authorization_code",
+ "redirect_uri" => "http://test.localhost/auth/microsoft_office365/callback",
+ ),
+ ).to_return(
+ status: 200,
+ body:
+ Rack::Utils.build_query(
+ access_token: access_token,
+ token_type: "Bearer",
+ expires_in: 3599,
+ scope: "openid email profile https://graph.microsoft.com/User.Read",
+ ),
+ headers: {
+ "Content-Type" => "application/x-www-form-urlencoded",
+ },
+ )
+ end
+
+ it "signs in the user whose email matches the email included in the API response from microsoft when `microsoft_auth_email_verified` site setting is true" do
+ SiteSetting.microsoft_auth_email_verified = true
+
+ post "/auth/microsoft_office365"
+
+ expect(response.status).to eq(302)
+ expect(response.location).to start_with(
+ "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
+ )
+
+ setup_ms_emails_stub(email: user1.email)
+
+ post "/auth/microsoft_office365/callback",
+ params: {
+ state: session["omniauth.state"],
+ code: temp_code,
+ }
+
+ expect(response.status).to eq(302)
+ expect(response.location).to eq("http://test.localhost/")
+ expect(session[:current_user_id]).to eq(user1.id)
+ end
+
+ it "does not sign in the user whose email matches the email included in the API response from microsoft when `microsoft_auth_email_verified` site setting is false" do
+ SiteSetting.microsoft_auth_email_verified = false
+
+ post "/auth/microsoft_office365"
+
+ expect(response.status).to eq(302)
+ expect(response.location).to start_with(
+ "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
+ )
+
+ setup_ms_emails_stub(email: user1.email)
+
+ post "/auth/microsoft_office365/callback",
+ params: {
+ state: session["omniauth.state"],
+ code: temp_code,
+ }
+
+ expect(response.status).to eq(302)
+ expect(response.location).to eq("http://test.localhost/")
+ expect(session[:current_user_id]).to eq(nil)
+ end
+
+ context "when configured as single tenant" do
+ it "uses the tenant id from the site setting" do
+ SiteSetting.microsoft_auth_tenant_id = "my-tenant-id"
+
+ post "/auth/microsoft_office365"
+
+ expect(response.status).to eq(302)
+ expect(response.location).to start_with(
+ "https://login.microsoftonline.com/my-tenant-id/oauth2/v2.0/authorize",
+ )
+ end
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/spec/lib/microsoft_auth_revoker_spec.rb b/plugins/discourse-microsoft-auth/spec/lib/microsoft_auth_revoker_spec.rb
new file mode 100644
index 00000000000..3ab2a3137b6
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/spec/lib/microsoft_auth_revoker_spec.rb
@@ -0,0 +1,90 @@
+# frozen_string_literal: true
+
+require_relative "../../lib/microsoft_auth_revoker"
+
+RSpec.describe MicrosoftAuthRevoker do
+ describe ".revoke" do
+ fab!(:user_1) { Fabricate(:user).tap { |user| UserAuthToken.generate!(user_id: user.id) } }
+ fab!(:user_2) { Fabricate(:user).tap { |user| UserAuthToken.generate!(user_id: user.id) } }
+ fab!(:user_3) { Fabricate(:user).tap { |user| UserAuthToken.generate!(user_id: user.id) } }
+
+ fab!(:microsoft_user_associated_account_for_user_1) do
+ UserAssociatedAccount.create!(
+ provider_name: "microsoft_office365",
+ user_id: user_1.id,
+ provider_uid: 100,
+ info: {
+ email: "[email protected]",
+ },
+ )
+ end
+
+ fab!(:microsoft_user_associated_account_for_user_2) do
+ UserAssociatedAccount.create!(
+ provider_name: "microsoft_office365",
+ user_id: user_2.id,
+ provider_uid: 200,
+ info: {
+ email: "[email protected]",
+ },
+ )
+ end
+
+ fab!(:facebook_user_associated_account_for_user_3) do
+ UserAssociatedAccount.create!(
+ provider_name: "facebook",
+ user_id: user_1.id,
+ provider_uid: 100,
+ info: {
+ email: "[email protected]",
+ },
+ )
+ end
+
+ fab!(:user_api_key_for_user_1) { Fabricate(:user_api_key, user: user_1) }
+ fab!(:user_api_key_for_user_2) { Fabricate(:user_api_key, user: user_2) }
+ fab!(:user_api_key_for_user_3) { Fabricate(:user_api_key, user: user_3) }
+ fab!(:api_key_for_user_1) { Fabricate(:api_key, created_by_id: user_1.id) }
+ fab!(:api_key_for_user_2) { Fabricate(:api_key, created_by_id: user_2.id) }
+ fab!(:api_key_for_user_3) { Fabricate(:api_key, created_by_id: user_3.id) }
+
+ it "should delete all microsoft provider `UserAssociatedAccount` records" do
+ expect do MicrosoftAuthRevoker.revoke end.to change { UserAssociatedAccount.count }.by(-2)
+ expect(UserAssociatedAccount.where(provider_name: "microsoft_office365").count).to eq(0)
+ end
+
+ it "should deactivate all users with microsoft provider `UserAssociatedAccount` records" do
+ expect do MicrosoftAuthRevoker.revoke end.to change { User.where(active: true).count }.by(-2)
+ expect(user_1.reload.active).to eq(false)
+ expect(user_2.reload.active).to eq(false)
+ expect(user_3.reload.active).to eq(true)
+ end
+
+ it "should delete all `UserAuthToken` records for users with microsoft provider `UserAssociatedAccount` records" do
+ expect do MicrosoftAuthRevoker.revoke end.to change { UserAuthToken.count }.by(-2)
+ expect(UserAuthToken.where(user_id: user_1.id).count).to eq(0)
+ expect(UserAuthToken.where(user_id: user_2.id).count).to eq(0)
+ expect(UserAuthToken.where(user_id: user_3.id).count).to eq(1)
+ end
+
+ it "should revoke all `UserApiKey` records for users with microsoft provider `UserAssociatedAccount` records" do
+ expect do MicrosoftAuthRevoker.revoke end.to change {
+ UserApiKey.where(revoked_at: nil).count
+ }.by(-2)
+
+ expect(user_api_key_for_user_1.reload.revoked_at).to be_present
+ expect(user_api_key_for_user_2.reload.revoked_at).to be_present
+ expect(user_api_key_for_user_3.reload.revoked_at).to be_nil
+ end
+
+ it "should revoke all `ApiKey` records created by users with microsoft provider `UserAssociatedAccount` records" do
+ expect do MicrosoftAuthRevoker.revoke end.to change {
+ ApiKey.where(revoked_at: nil).count
+ }.by(-2)
+
+ expect(api_key_for_user_1.reload.revoked_at).to be_present
+ expect(api_key_for_user_2.reload.revoked_at).to be_present
+ expect(api_key_for_user_3.reload.revoked_at).to be_nil
+ end
+ end
+end
diff --git a/plugins/discourse-microsoft-auth/spec/system/core_features_spec.rb b/plugins/discourse-microsoft-auth/spec/system/core_features_spec.rb
new file mode 100644
index 00000000000..db86db283bd
--- /dev/null
+++ b/plugins/discourse-microsoft-auth/spec/system/core_features_spec.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+RSpec.describe "Core features", type: :system do
+ before { enable_current_plugin }
+
+ it_behaves_like "having working core features"
+end
diff --git a/translator.yml b/translator.yml
index 11a4a5dedb1..473c6c320ff 100644
--- a/translator.yml
+++ b/translator.yml
@@ -122,3 +122,10 @@ files:
- source_path: plugins/discourse-apple-auth/config/locales/server.en.yml
destination_path: plugins/apple-auth/server.yml
label: apple-auth
+
+ - source_path: plugins/discourse-microsoft-auth/config/locales/client.en.yml
+ destination_path: plugins/microsoft-auth/client.yml
+ label: microsoft-auth
+ - source_path: plugins/discourse-microsoft-auth/config/locales/server.en.yml
+ destination_path: plugins/microsoft-auth/server.yml
+ label: microsoft-auth