Enable users to log in using their Microsoft accounts (aka Office 365 or Microsoft 365 accounts)
Install Guide
This plugin is bundled with Discourse core. There is no need to install the plugin separately.
Summary
Microsoft Authentication enables users to log in to your Discourse forum using their Microsoft accounts (also known as Office 365 or Microsoft 365 accounts). This simplifies the login process for organizations that use Microsoft services.
Visit Certificates & secrets in the left sidebar menu and click New client secret
Add a simple description
Choose 24 months under “Expires” (note: you’ll need to renew it)
Copy the Value (this is the Application Secret) and save it for your plugin settings
Visit Overview (in the left sidebar) and copy the Application (client ID)
In your Discourse admin area, go to Settings and search for “microsoft auth”
Enter the Application ID and Secret from the previous steps
Single-tenant authentication issues
If you’ve configured your Microsoft application as single_tenant, some users may experience issues when logging in. This happens because the emails used for login are considered untrusted, and the system cannot automatically link them to existing Discourse accounts.
To resolve this issue, users can:
Look for the “Already have an account?” section at the bottom of the signup form
Click the provided link to go through the account link-up process
Complete the authentication steps to connect their Microsoft account to their existing Discourse account
Another option is to enable the microsoft auth email verified site setting, if admins are confident that all your users have verified emails.This ensures that returning users with existing accounts don’t create duplicate accounts when authenticating through Microsoft.
Additional configuration options
You can update all Microsoft Authentication settings by visiting the Admin > Settings area and searching for “microsoft auth”.
Проблема в том, что панель приложения Microsoft предлагает три похожих поля для «Секрета»: Client ID, Value и Secret ID. Без пояснений я оба раза выбирал не то поле, и подозреваю, что я не одинок в этом!
Проблема в слове “common”.
Похоже, его нужно заменить на ID арендатора для одиночного арендатора.
Если у вас есть учётная запись Microsoft, вы найдёте свой ID арендатора здесь: Microsoft Azure
Я пока не пробовал внести это изменение самостоятельно. Возможно, попробую.
Если нет, и вы тоже планируете использовать это для одиночного арендатора, не тратьте время — сейчас это не сработает.
См. прикреплённое изображение ниже в качестве примера ошибки, которую вы получите.
Хорошо, я никогда не программировал на Ruby, а с программированием и работой с техническими вещами я сталкивался несколько лет назад. Но всё готово. Теперь это работает и для конфигураций Single Tenant.
Этот плагин теперь включён в ядро Discourse в рамках Bundling more popular plugins with Discourse core. Если вы ведёте собственный хостинг и используете этот плагин, вам нужно удалить его из файла app.yml перед следующим обновлением.