-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure single-tenant application support, using the Graph API #6728
Azure single-tenant application support, using the Graph API #6728
Conversation
✅ Deploy Preview for chatwoot-storybook ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Will take a look 👍🏼 |
@moxvallix Would this change support the single tenant changes as well? |
@tejaswinichile sorry, I am not sure what other single tenant changes you refer to. Has there been changes to support single tenant applications in chatwoot since I made this branch? |
@moxvallix Concerned about the users who chose the single tenant as an account type, do you think this would work for that? And they will still need to update the tennt id? |
@tejaswinichile yes, these changes are to make single tenant applications work. The AZURE_TENANT_ID is required, as single tenant applications must authenticate to their own endpoint, which uses this id, rather than the common endpoint, which multi tenant use. This PR should have made no changes to how multi tenant works, but should have single tenant working. |
The PR overall seems alright; I will work on it further as I want to test if the customer has setup an email channel before the new endpoint, and the fetch process should be seamless with the update of tenant id. I will make some changes for the review and will add the test cases as well. |
It won't work with pre-existing, single tenant app channels. It requires a seperate OAuth token, to grant scopes for the Graph API. Considering that before this it was impossible to add channels from single tenant apps anyways, this shouldn't be an issue. If used with a multi tenant app, not setting AZURE_TENANT_ID will keep everything functioning as before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moxvallix Let me know if you get time to fix these, or I will.
Any status updates on this? We are currently having the same issue mentioned in the above. Appreciate the your guys' work @moxvallix and @tejaswinichile ! |
@AwakenTheJaken it should all be working, the branch basically just needs conformity changes, tests etc. You should be good to pull down these changes into your own instance (make sure you set AZURE_TENANT_ID to the ID of your Azure tenant). |
Thank you, appreciate it!~ |
@moxvallix Are you going to work on this es/fetch_imap_email_inboxes_job.rb ? |
Not sure exactly what is needed here? FetchImapEmailsJob already handles Microsoft email accounts when the TENANT_ID is not set. Unless you are wanting me to make it that the Graph API is used for multi-tenant apps as well? |
@moxvallix No. Just confirming if you are done with all the changes, I will open it for review and make the necessary changes from my side. Otherwise, PR works well. |
Ah okay, no worries. Yeah, I'm done with changes to this branch, I don't have much time to work on it right now regardless. All good for you to do whatever you need with it. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
This pull request adds support to Chatwoot for using single tenant Azure applications.
When the AZURE_TENANT_ID environment variable is set, Chatwoot will now use it within it's calls to Microsoft's API, rather than
common
, which only works for multi tenant applications.As well, this pull request also adds support for sending and retrieving emails through the Microsoft Graph API, rather than using IMAP / SMTP. This was because I was unable to get SMTP working with a single tenant application. As well, using this API will likely be needed in the future, as Microsoft are deprecating SMTP Auth.
https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online#pop-imap-and-smtp-auth
I would appreciate some help with getting this pull request up to standards. As it is currently not, I will leave it as a draft for now.
Type of change
How Has This Been Tested?
I have been hand testing this all myself in my local environment, but some help/guidance with writing proper tests would be appreciated.
Checklist: