kkapsner / keepassxc-mail

MailExtension to talk to keepassxc
GNU General Public License v3.0
62 stars 5 forks source link

M365 - Shared Mailbox #99

Open dico-hubnc opened 4 months ago

dico-hubnc commented 4 months ago

Hello,

I'm trying to automate login into shared mailbox from Microsoft 365. I was to able to find any information on how to do it.

Description

Suppose the main user account in M365 : main@domain.tld, and the shared account : shared@domain.tld. I add an entry in KeepassXC with : login = shared@domain.tld and for shared account, there is no valid password but we have to use 'login with another account' from Microsoft login page. I try to use login = main@domain.tld\shared but Thunderbird/KeePassXC-mail does not recognize this entry in KeepassXC. So, no way to automate the login process with M365 shared account.

Expected Behaviour

Auto login to my shared account transparently.

Current Behaviour

I have to fullfill the microsoft login every time by selecting 'login with another account' by hand.

Possible Solution

Add a special entry in KeepassXC (properties or somethingelse) in order to associate main account with an entry. For example : login = shared@domain.tld, login_as = main@domain.tld, password = (password of the login_as account). Leave login_as empty for main account.

Context

Add a shared M365 account in Thunderbird and wants to automate the login process by using KeepassXC entries.

Your Environment

Thunderbird 115.12.2 KeePassXC-mail 1.7 KeePassXC 2.7.9 Windows 10 Pro - 22H2

Thanks, DicoHub

kkapsner commented 4 months ago

Do you have "Save new credentials" enabled?

Please provide screenshots of the login screens you have to use and the output of the console (Ctrl+Shift+J and select "multi process"). When I have this information I might be able to determine if this can be done.

dico-hubnc commented 4 months ago

Hello,

Many thanks for your quick response. Here you can see that 'save new credentials' is enabled : image After that I open output console and I saw that password is not stored : image So, I just come back to keepassxc-mail settings : untick 'save new credentials' and tick again; and after that messages changed : image Finally, I untick 'save new credentials', tick 'save new credentials without confirmation' (as I receive a lot of confirmation on KeepassXC application), and click on 'erase selected entries' (I think old linked data was also the culprit) : image At this time, it seems to work as expected. Once again, thanks for your support.

Regards, DicoHub

kkapsner commented 4 months ago

Please check the Thunderbird password manager (and the console as well). With your settings now I think the oauth tokens are stored there and not in KeePassXC.

dico-hubnc commented 4 months ago

Hello,

Arrggg, you're right. So I just deleted password inside Thunderbird (TB), but now every time a password is requested, KeepassXC provides to TB, and then I got a popup on KeepassXC saying : 'would you like to save modifications on xxx account'. If I do not confirm this popup, the password is saved on TB after a timeout. image I also try to activate 'save new credentials without confirmation' like this : image but no change...popup happens on each TB account's check/verification. It seems that auto-saving password update is not activated.

Update : after closing TB and re-open it, all my KeepassXC's accounts are doubled/tripled... I notice that uuid is null image Inside KeepassXC : (the last entry is the first one that I saved with TOTP, the 2 others are duplicated automatically by TB) image

kkapsner commented 2 months ago

but no change...popup happens on each TB account's check/verification.

is this popup from TB or form KeePassXC?

I notice that uuid is null

this means it creates a new entry. For me the automatic update works... but I think I selected "Do not ask me again" on the saving dialog once. So if you do that it might work.

kkapsner commented 2 months ago

I think I found the issue with the duplications - it seems related to the "auto submit". Please try to uncheck that.