update the smtp provider to support oauth authentication.#5460
update the smtp provider to support oauth authentication.#5460mitchelsellers merged 20 commits intodnnsoftware:developfrom
Conversation
Fixed an issue that prevented sending smtp test emails Due to the UI changes in dnnsoftware#5152 the frontend now posts an obfuscated password unless the user is currently changing the password. That scenario got handled correctly for UpdateSmtpSettings but the same logic needed to be implements in SendTestEmail for that button to work fine.
valadas
left a comment
There was a problem hiding this comment.
Very nice, I left a couple of questions/suggestiions and would like to give it a quick test before approving. I can do that with gmail I guess ?
Dnn.AdminExperience/ClientSide/Servers.Web/src/components/Tabs/SmtpServer.jsx
Outdated
Show resolved
Hide resolved
...ience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.Servers/App_LocalResources/Servers.resx
Outdated
Show resolved
Hide resolved
|
Thanks so much @valadas , the suggestions have been applied. |
Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/ServerSettingsSmtpAdminController.cs
Outdated
Show resolved
Hide resolved
|
@zyhfish am I correct to understand that this change doesn't do anything until you have an |
Hi @bdukes , thanks so much for your update, can you please ping me on Slack when you are online, so that we can discuss further, thx. |
bdukes
left a comment
There was a problem hiding this comment.
I still need to see an ISmtpOAuthProvider implementation to test the frontend, but I've adjusted the backend to have fewer dependencies directly on MailKit, and I'm happy with how things stand now.
|
Am I to understand that addition of this, at this time does NOT give the DNN Platform the proper ability to utilize OAuth? If this is correct, do we have the information available, in the extension points created to actually create something that is of value for the open source project? |
|
Correct, to add an implementation to the open source project, we would need to create classes that implement the |
|
Hi @mitchelsellers , is this PR able to be merged and included in next release? thx |
|
@zyhfish since this is a new feature, we're planning to hold this PR for a 9.12 or 10.0 release |
|
@zyhfish since this is a feature, we are holding this one until the next minor release. Thanks! |
@zyhfish I'm with @mitchelsellers here - are there plans for an implementation to be provided? |
|
Just to update everyone since this is a public channel. I've been in communication offline with @zyhfish about what is needed to accept/merge this item |
|
Hi @mitchelsellers @david-poindexter , the gmail/exchange implementations have been added, can you please help to check? thx |
|
Awesome! Thanks @zyhfish I'll try my best to test/review tomorrow... |
|
@zyhfish I have fixed a couple of stylecop issues that prevented the build from running. Now we have 2 failing tests, can you help on those ? |
|
I just pushed a change to those tests 🤞🏻 |
|
I pushed a few commits to clean up the code, moving from |
Use async where available Use file-scoped namespaces Remove unused code
e0cbd5f to
8f63392
Compare
|
@zyhfish do you have some sort of documentation on the process to use Exchange and/or google ones. I managed to figure out to get oauth working with exchange but it apparently needs also to have smtp configured and I am not sure what that should be set to... |
valadas
left a comment
There was a problem hiding this comment.
Ok, so the MailKit repository has some docs for both Google and Exchange and I managed to test the google one and it works fine. For Exchange, my Microsoft accounts are all messed up and I could not get it to find the right tenant and stuff. But I got to the OAuth authentication part working, so this looks good to me. Thanks @zyhfish
|
I am using the new DNN_Platform_9.13.0-rc0001 in a test environment to attempt to connect it to my Exchange instance via OAuth 2.0. I have succeeded in connecting to the Registered App using the new provider: ...and I have provided the App with the following permissions: ...further, I have used the
However, when I attempt to send a test email, I get the following error message: Am I missing something? Am I posting this question in the wrong place? Any assistance would be most appreciated. Thank you for all of your work on making this and all the other features of DNN. PS. I should add that this DNN instance is running in Azure as an App Service on the same tenant as the Exchange server. I'm not sure if that makes a difference, but I thought it was worth stating. |
|
@zyhfish I was also able to do the oAuth part and got into some other issues afterwards, so I was only able to properly test the google one. Do you have some guidance or docs we could add to the feature to help people setup ? |
|
@zyhfish I have re-read the instructions I linked to above and confirmed that my configuration is set up correctly. I also added the delegated permission |
|
@dowdian unfortunatelly not, I don't know enough in the azure world to even know how to begin troubleshooting this. @zyhfish told me he tested it, so I guess it's just a matter of jiggling all the handles right... One think you may want to double-check, are you sending the test emails with a "from" address that matches the exchange account address ? |






Fix #5139.