diff --git a/app/controllers/microsoft_controller.rb b/app/controllers/microsoft_controller.rb
new file mode 100644
index 000000000..36c350c3d
--- /dev/null
+++ b/app/controllers/microsoft_controller.rb
@@ -0,0 +1,5 @@
+class MicrosoftController < ApplicationController
+ def identity_association
+ render layout: false
+ end
+end
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue
index 7c788ba37..e986362ba 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue
@@ -471,6 +471,7 @@ export default {
this.isALineChannel ||
this.isAPIInbox ||
(this.isAnEmailChannel && !this.inbox.provider) ||
+ (this.isAnEmailChannel && this.inbox.provider === 'microsoft') ||
this.isAWhatsAppChannel ||
this.isAWebWidgetInbox
) {
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/microsoft/Reauthorize.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/microsoft/Reauthorize.vue
new file mode 100644
index 000000000..7f86020a4
--- /dev/null
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/microsoft/Reauthorize.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue
index 57498c5d8..0229f03b3 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue
@@ -90,6 +90,10 @@
+
@@ -109,12 +113,14 @@ import inboxMixin from 'shared/mixins/inboxMixin';
import SettingsSection from '../../../../../components/SettingsSection';
import ImapSettings from '../ImapSettings';
import SmtpSettings from '../SmtpSettings';
+import MicrosoftReauthorize from '../channels/microsoft/Reauthorize';
export default {
components: {
SettingsSection,
ImapSettings,
SmtpSettings,
+ MicrosoftReauthorize,
},
mixins: [inboxMixin, alertMixin],
props: {
diff --git a/app/views/microsoft/identity_association.json.erb b/app/views/microsoft/identity_association.json.erb
new file mode 100644
index 000000000..4cfacef02
--- /dev/null
+++ b/app/views/microsoft/identity_association.json.erb
@@ -0,0 +1,7 @@
+{
+ "associatedApplications": [
+ {
+ "applicationId": "<%= ENV['AZURE_APP_ID'] %>"
+ }
+ ]
+ }
diff --git a/config/routes.rb b/config/routes.rb
index 912324842..13cb9cedc 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -350,6 +350,7 @@ Rails.application.routes.draw do
# Routes for external service verifications
get 'apple-app-site-association' => 'apple_app#site_association'
get '.well-known/assetlinks.json' => 'android_app#assetlinks'
+ get '.well-known/microsoft-identity-association.json' => 'microsoft#identity_association'
# ----------------------------------------------------------------------
# Internal Monitoring Routes
diff --git a/spec/controllers/microsoft_controller_spec.rb b/spec/controllers/microsoft_controller_spec.rb
new file mode 100644
index 000000000..6ce22d66b
--- /dev/null
+++ b/spec/controllers/microsoft_controller_spec.rb
@@ -0,0 +1,13 @@
+require 'rails_helper'
+
+describe '/.well-known/microsoft-identity-association.json', type: :request do
+ describe 'GET /.well-known/microsoft-identity-association.json' do
+ it 'successfully retrieves assetlinks.json file' do
+ with_modified_env AZURE_APP_ID: 'azure-application-client-id' do
+ get '/.well-known/microsoft-identity-association.json'
+ expect(response).to have_http_status(:success)
+ expect(response.body).to include '"applicationId": "azure-application-client-id"'
+ end
+ end
+ end
+end