Comments (16)
@Valdnet @tobiasKaminsky @eneiluj Thanks for confirming this issue and running some tests. I managed to reproduce the issue on my android emulator (android 7). I'm working on a fix right now. It looks like you'll have to grant the Android GET_ACCOUNTS
permission manually before being able to access the account data.. Very annoying...
from android-singlesignon.
@tobiasKaminsky It's working if you compile it using android studio as they have the same signature then and therefore android grants you the permission to access the accounts..
from android-singlesignon.
As far as I know it should not matter which combination you use. @tobiasKaminsky Or is there a difference wether you install the files app from the play store or from the f-droid store?
It should not, as the package name is the same.
from android-singlesignon.
@David-Development It works like a charm with v0.3.1.Thanks a lot. I can confirm GET_ACCOUNTS
permission is required with Android 7.
from android-singlesignon.
@David-Development Works correctly on Android 4.4.2 and 6 👍
from android-singlesignon.
@eneiluj Sorry for the delay. Thanks for using the library! Glad you like it! :)
I think I fixed the crash by adding a null check (https://github.com/nextcloud/Android-SingleSignOn/blob/master/src/main/java/com/nextcloud/android/sso/AccountImporter.java#L267).
If the account is null
, the exception (that you encountered) will be thrown. This should only happen when the app is reinstalled and there are some issues with the reauthentication.
I'm not exactly sure what's happening with the account on your device.. It looks like the call to AccountImporter.getAccountForName(...)
doesn't return the account itself. Which means that something went wrong while granting the permissions of the account to your app.. (android account permissions itself).
Basically the call to AccountManager.newChooseAccountIntent(...)
should be sufficient. Not sure why it's not working.. 😕(Ref: https://stackoverflow.com/a/49829475/11405479)
from android-singlesignon.
Do you have a branch/tag we can check out, to try it ourselves?
from android-singlesignon.
@David-Development The crash was just happening with v0.3.0, not with "-SNAPSHOT" version. Yes it seems the problem is not entirely related to SSO but with system permission granting system. It's happening on all devices with Android >= 6 and <= 7.1
@tobiasKaminsky Yep:
git clone --recurse-submodules https://gitlab.com/eneiluj/phonetrack-android -b sso-issue
This is an Android Studio project.
Thank you both for your answer!
from android-singlesignon.
@eneiluj I tried
- your sso-issue branch with 0.3.0 instead of -SNAPSHOT
- Android 7.0
- latest Files app
--> works without problems
from android-singlesignon.
With a virtual device running Android AOSP (without google services), Nextcloud files app: v3.6.0 and PhoneTrack using SSO lib SNAPSHOT, I reach the account selection dialog:
and after having selected one, I directly get this dialog:
with SSO lib v0.3.0, I get a crash from Nextcloud files app instead of dialog of previous screenshot:
Quite strange we get different behaviours... Are you using stable F-Droid release of Nextcloud Files app v3.6.0?
from android-singlesignon.
So I used
-
Android 7
-
Android Files app master / 3.6.0 with Android Studio
-
phonetrack with master-SNAPSHOT for SSO
--> working -
Android 7
-
Android Files app 3.6.0 from F-Droid
-
phonetrack with master-SNAPSHOT for SSO
--> NOT working
For some reason account is null, but
if account is null NextcloudFilesAppAccountPermissionNotGrantedException should be thrown…
from android-singlesignon.
I confirm the problem with SSO on Android 6. There is a crash of Nextcloud Android v3.6.0 after selecting an account.
App:
Nextcloud Android v3.6.0 gplay
PhoneTrack Dev v0.0.10 with SSO
from android-singlesignon.
@David-Development Thanks a lot for fixing this!
For the moment SSO lib acts like 'get accounts' permission is not granted with Nextcloud Files installed from F-Droid and PhoneTrack compiled with Android Studio even though I can see the permission for PhoneTrack in system settings... I get the error dialog saying "...you need to grant permission to access your accounts".
Can I assume it might work with both PhoneTrack and Files installed from F-Droid?
from android-singlesignon.
@eneiluj Which version of the sso library are you using? Version 0.3.1 should fix this issue. However please not that you might need to add some additional code for handling the permission callbacks.
As far as I know it should not matter which combination you use. @tobiasKaminsky Or is there a difference wether you install the files app from the play store or from the f-droid store?
from android-singlesignon.
I still find this problem on a customized android 11 ROM, tried to reinstall both nextcloud and third-party app with giving all permission before logging in, but still failed.
from android-singlesignon.
@SpinningK did you also add
<queries>
<package android:name="com.nextcloud.client" />
<package android:name="com.nextcloud.android.beta" />
</queries>
to your AndroidManifest.xml
as described in the FAQ? If not please open a new issue and provide a minimal sample repository with an app to reproduce the issue.
from android-singlesignon.
Related Issues (20)
- Provide convenience class for OCS requests HOT 4
- Support .qa package id of the files app
- Convenience features for `NextcloudRequest.Builder`
- Handle `QueryParam` with key "`c`" HOT 4
- SEARCH HTTP method is not supported HOT 7
- Support Activity Result API HOT 3
- Rotation issues
- i18n: `Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE).` HOT 7
- If only dev app is installed SSO doesn't work HOT 8
- Break on minified app HOT 12
- Migrate to Material 3 theme HOT 1
- Option to create new token on `TokenMismatchException` HOT 3
- Availablity on Amazon store HOT 1
- Instantiating `Void` does no longer work with AGP 8 HOT 18
- Improve SSO error dialogs shown by 3rd-party-apps HOT 2
- Check `NetworkRequest#mDestroyed` before each network request? HOT 1
- Readme contains bad R8 advice HOT 1
- Reportedly not working when used within Samsung Knox HOT 1
- Possibility to get WebDAV-capable app password/token from SSO HOT 5
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-singlesignon.