Skip to content
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

Add support for OneDrive for Business #55

Closed
carpac opened this issue Oct 17, 2017 · 48 comments
Closed

Add support for OneDrive for Business #55

carpac opened this issue Oct 17, 2017 · 48 comments
Milestone

Comments

@carpac
Copy link

carpac commented Oct 17, 2017

When I try to open a database that is stored on OneDrive for Business, I always get a "password is wrong" error (although I am pretty sure that I typed in the correct password). Does Keepass2Android work with OneDrive for Business, too, or only with OneDrive (the "consumer" version)?

@PhilippC
Copy link
Owner

OneDrive for Business is currently not supported. As far as I understand I need a MS subscription account just for including this feature.

@PhilippC PhilippC changed the title Cannot connect to OneDrive for Business Add support for OneDrive for Business Oct 20, 2017
@carpac
Copy link
Author

carpac commented Oct 25, 2017

I don't know if you need a MS subscription account. On my Windows pc I am using KeePass with the plugin "KeePass OneDrive Sync" (see https://github.com/KoenZomers/KeePassOneDriveSync). Maybe you could ask the author of this plugin, Koen Zomers, what is needed to support OneDrive for Business.

@kribjo
Copy link

kribjo commented Mar 2, 2018

I am also very interested in this. As carpac commented it is working with that plugin. I guess it is because its developer has the needed MS developer account.

I would be interested in sponsoring an account for the developer of this app. Which account would be needed (individual/company) and how much would it be (region dependent, see link below)? Is that an option?

https://docs.microsoft.com/sv-se/windows/uwp/publish/account-types-locations-and-fees

@kribjo
Copy link

kribjo commented Mar 2, 2018

Here is some further information, seems the client secret can be created without expiration.
KoenZomers/KeePassOneDriveSync#51

@PhilippC PhilippC added this to the 1.06 milestone Jun 23, 2018
@PhilippC
Copy link
Owner

please use the thumbs-up reaction on the issue itself. I occasionally sort issues for this reaction when I try to decide which features will be included for the next release.

Repository owner deleted a comment from JaneX8 Sep 21, 2018
Repository owner deleted a comment from cmruffin Sep 21, 2018
Repository owner deleted a comment from legolasdimir Sep 21, 2018
Repository owner deleted a comment from Wiredframe Sep 21, 2018
Repository owner deleted a comment from mainlt Sep 21, 2018
Repository owner deleted a comment from tswierkot Sep 21, 2018
@CartCaved
Copy link

Not sure what was in the deleted comments, but I was wondering if there is anything in addition to using the thumbs-up to help make this feature happen?

@pstorch
Copy link

pstorch commented Dec 8, 2018

I'm also interested in this feature.

It looks like OneDrive for business needs a different authentication mechanism:
https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/aad-oauth?view=odsp-graph-online

And the developer needs an Office 365 subscription: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration-server?view=odsp-graph-online

A developer subscription would cost 99$ per year 😢

@jpdied
Copy link

jpdied commented Dec 9, 2018

I would be willing to donate the sub fee for this feature. I'm sure there might be a few who would also chip in for a developer o365 sub.

@PhilippC
Copy link
Owner

I have purchased a Developer subscription and re-implemented OneDrive access using the new MS Graph SDK. It seems to be working for personal accounts but I can't access my OneDrive for business account, so for now that's no improvement...
@kribjo I am not sure if something is wrong with my account so if you have the possibility to create another account for me for testing just for a month, I'd be really grateful. Any subscription which comes with OneDrive for business access would be fine.

@PhilippC
Copy link
Owner

@kribjo please ignore my request, I think the error is more related to my app configuration than to the account.

@michielhageman
Copy link

Hi Philipp,
Just installed your app, also try to connect to the .kdbx on my Onedrive for Business. Do you think you will be able to add the above mentioned support for it? Would be great!
Regards,
Michiel

@PhilippC
Copy link
Owner

@michielhageman as you may read in the posts above yours - I am trying to do so but wasn't successful so far yet.

@MarkJenniskens
Copy link

@PhilippC thanks for your effort. This feature would be great. Currently rolled out KeePass in our company, so O4B support would be much appreciated. If you need anything let me know.

@mplogas
Copy link

mplogas commented Feb 12, 2019

It seems to be working for personal accounts but I can't access my OneDrive for business account, so for now that's no improvement...

@PhilippC So this is either an issue in your app registration (in the Microsoft App Registration Portal) or you're not using the ADALv2 authentication endpoint. I would assume it's the latter, as you're still using MS-ADAL 1.14. Have you tried the "MSA Auth For Android Adapter" with the Graph SDK already?

@PhilippC
Copy link
Owner

@mplogas thanks a lot for taking a look! I am close to giving up on this, but it would be awesome if we could solve this issue and I really appreciate any help.
I am not exactly sure if I understand what you mean. Please note that I currently have two OneDrive implementations in the repo (my plan was to keep the old implementation so users which are currently using OneDrive can continue and don't have to re-login or anything, but use the new implementation for new connections).
The new implementation can be found on https://github.com/PhilippC/keepass2android/blob/master/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/OneDriveStorage2.java.
It uses the PublicClientApplication class and I don't think this is still using the ADAL 1.14, right?
I rather have the feeling that it might be an issue with my app registration, I don't even know if the Office 365 Enterprise E3 Developer subscription which I have purchased for this is what I need (I received a "free credit has expired" mail from Microsoft some days after setting everyithng up).
If you think my implementation is ok, what should I provide so you can take a look at the app registration?
Again, thanks a lot for any help!

@mhors
Copy link

mhors commented May 25, 2019

I have a slightly different experience. Not "password is wrong" but when I try to open OneDrive for Business with an account name of x@y.onmicrosoft.com, I get "that Microsoft account does not exist" even though I can open this account on OneDrive for Android. This onmicrosoft.com domain is used when you don't want to associate your own domain with the OneDrive account.

@J-O-P
Copy link

J-O-P commented May 26, 2019

I also need this feature, as I am moving all my data from "OneDrive Personal" to "OneDrive for Business". As in the previous post: When I enter the UserID of my "OneDrive for Business" account I get the error "Account does not exist" in KeePass4Android (Apparently it only finds OneDrive Personal accounts). A short search brought me here to this topic to find out OneDrive for Business is not supported yet. Let me know if there is anything I can help with.

@Edouard37
Copy link

Hello Philipc, how can i help you ? i have ent account on OneDrive for business.
Thank you. I test OneDrive with a pesonnal account : work great ! But i want now to deploy over 3000 users… :-)

@karol-gro
Copy link

Hi @PhilippC
If you need an enterprise account with OneDrive and some other licenses I can provide you with a few for free.
Thanks for all the work ;)

@ethzero
Copy link

ethzero commented Jul 29, 2019

+1, regarding the: "OneDrive for Business" account I get the error "Account does not exist" in KeePass4Android.

@vepman
Copy link

vepman commented Aug 5, 2019

I need this feature also

@mpneo
Copy link

mpneo commented Aug 29, 2019

I use this app now - for sure with some good new features. Anyway: It's not working with OneDrive for Business via the menu. I tried also using OAuth via Github but you can not add OneDrive for Business because it's not possible with work or school accounts (you get that information when you try). I think that is the problem: It's not allowed from Microsoft to authorise other Apps to access OneDrive for Business via OAuth and that's why you can't use KeePass2Android for that. I used before the KeePass2Android Offline Version and this simple works if you go to the database file in your OneDrive App and then open it with the Offline Version. If you then Open the Offline Version it automatically tries to open the database file, so you don't have to go again through the OneDrive App. THIS WORKS ALSO for the new KeePass2Android Version! So you just have to select it and then you're fine. So from my side: Problem solved in that way.

@pstorch
Copy link

pstorch commented Aug 29, 2019

@MPNeosociety I tried it. Opening is possible, but when I change something KeePaas2Android can't save it.

@vepman
Copy link

vepman commented Aug 29, 2019

It's not allowed from Microsoft to authorise other Apps to access OneDrive for Business via OAuth and that's why you can't use KeePass2Android for that.

No, other Apps can use Onedrive for Business via OAuth. For example, X-plore for Android works.

@PhilippC
Copy link
Owner

note for myself: it looks like https://github.com/microsoftgraph/android-java-snippets-rest-sample has an up-to-date documentation on how to implement this. Will try when I'm back from my current travel.

@vepman
Copy link

vepman commented Aug 30, 2019

Great, wish you a good journey.

@PhilippC
Copy link
Owner

PhilippC commented Sep 1, 2019

I couldn't wait and installed Android Studio on a laptop I have with me. After a while I was able to find the required changes to my previous code to get this working! Finally!
(At least on the Java side. Integration into the main app is still pending and has to wait until I return home in a week.)

One thing that I would like to test/implement is working with shared files (because this currently is not working):

Can anybody share a file or folder with me for testing? I'd prefer a simple text file plus a kdbx file for testing (with master password "test").
My Office365 account is PhilippC@crocoapps.onmicrosoft.com.

Would be great if someone could share a txt+kdbx file also with a "personal" OneDrive account (not OneDrive for business) with my personal OneDrive account: philipp.crocoll@web.de
because I'm using the same implementation for both and would like to test both.

Thanks in advance!

@pstorch
Copy link

pstorch commented Sep 1, 2019

@PhilippC I've sent you an invite to a shared folder.

@PhilippC
Copy link
Owner

PhilippC commented Sep 1, 2019

@pstorch thanks! Unfortunately it looks like I can access the files through the browser, but I don't see them as "Shared with me" (if I click Share on the files and type my email address, it says your organization doesn't allow sharing with me). I'm not experienced with this, but it looks like there are different ways to share. I would need to see the folder in "Shared with me" to try to access it from Keepass2Android.

@pstorch
Copy link

pstorch commented Sep 1, 2019

I don't have other share options. I could share the individual files as well, but I guess this is not what we would like to test.
Do you have to include the shared folder into your personal library?

@PhilippC
Copy link
Owner

PhilippC commented Sep 1, 2019

@qj0n as I have now a first implementation of this, I would like to do some testing with using files from different accounts. I only have one, so another O365 account would be great. Can you send credentials to crocoapps@gmail.com

@paoIpao
Copy link

paoIpao commented Sep 2, 2019

I shared a folder with you PhilippC with OneDrive for business

@Mr-Pingu
Copy link

Mr-Pingu commented Sep 3, 2019

@PhilippC if still needed I can supply you a shared folder, both onedrive business & personal. Let me know. Really waiting for oneDrive business support :)

@PhilippC
Copy link
Owner

PhilippC commented Sep 3, 2019

it looks like @paololec and @pstorch have shared the folder using the "Share" button and then directly inputting my email, but this didn't work as I couldn't import the folder to my OneDrive. Maybe someone (e.g. @Mr-Pingu ) can try to click "Share" and then "Manage access", then under "Grant access" type my mail?

@paoIpao
Copy link

paoIpao commented Sep 3, 2019

@PhilippC I have also give you grant access.

@Edouard37
Copy link

Edouard37 commented Sep 3, 2019 via email

@PhilippC
Copy link
Owner

PhilippC commented Sep 3, 2019

either I am doing something wrong or this does not work across domains or between your type of business accounts and my E3 developer account. Anybody with access to more than one account to test sharing internally first?

@paoIpao
Copy link

paoIpao commented Sep 3, 2019

@PhilippC if you have E3 developer Subscription you have 25 account with license, you can add an account in admin.microsoft.com -> active users -> add user

@PhilippC
Copy link
Owner

PhilippC commented Sep 3, 2019

unfortunately I have just one, but I talked to MS support and they told me how I can activate test licences.
BTW they also confirmed that sharing is not possible across different domains.

@Mr-Pingu
Copy link

Mr-Pingu commented Sep 4, 2019

@PhilippC I could test here with two accounts within the same domain. Do you have sort an APK i could install and test?

Another option would be to give you short-term access to our domain.

@PhilippC
Copy link
Owner

PhilippC commented Sep 4, 2019

thanks for the offer, @Mr-Pingu . But I think I will first try to work wtih the test licenses!

@PhilippC
Copy link
Owner

PhilippC commented Oct 4, 2019

I finally made it. Thanks for the patience, everyone :-)

Here it is:
Version 1.07b-pre2 (just published to beta, see https://play.google.com/apps/testing/keepass2android.keepass2android) has support for OneDrive for Business, but also for shared files, app folder access, multiple accounts etc.

Please click "Change database" (on the password screen), then "Open database", "One Drive", "All files and shared files" (or something else if appropriate) and browse to your file.

Let me know if you have any trouble.

@PhilippC PhilippC closed this as completed Oct 4, 2019
@Edouard37
Copy link

Edouard37 commented Oct 4, 2019 via email

@michielhageman
Copy link

michielhageman commented Oct 4, 2019 via email

@pstorch
Copy link

pstorch commented Oct 4, 2019

Maybe I'm doing something wrong: I don't have "Open database", but "Open file...". When I choose OneDrive there I can enter my company email, but OneDrive says "That Microsoft account doesn't exist". 🤔

@PhilippC
Copy link
Owner

PhilippC commented Oct 4, 2019

You're right, it's called "Open file". If you click OneDrive, do you see the dialog to choose the variant (All files, shared files, app folder)? If not, you're probably running the old version? You can also check in app settings / about?

@pstorch
Copy link

pstorch commented Oct 4, 2019

Ah, sorry, after changing from release to the test channel I got an update on Version 1.07b-pre1 not pre2. I've now checked again and got pre2.
It's working. 🎉 Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests