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

Account access permissions #391

Open
0xf104a opened this issue Oct 5, 2021 · 4 comments
Open

Account access permissions #391

0xf104a opened this issue Oct 5, 2021 · 4 comments

Comments

@0xf104a
Copy link

0xf104a commented Oct 5, 2021

Hello.
I am developing NextcloudServices app. Recently one of users have experinced issue with logging-in via SingleSignOn(issue #22) on older Android version. So I have added permissions connected with accounts:

    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />

But still in the emulator(AOSP 7.1.1) app shows the error about permissions. In the log following error is displayed whenever authentication is attempted:

2021-10-05 14:34:41.220 2512-2512/com.polar.nextcloudservices E/com.nextcloud.android.sso.AccountImporter: Permission not granted yet!
@David-Development
Copy link
Member

David-Development commented Oct 19, 2021

@Andrewerr Sorry for the delay - I am currently on vacation and I didn't see this earlier. The log entry is written here:

if (ContextCompat.checkSelfPermission(context, Manifest.permission.GET_ACCOUNTS) != PackageManager.PERMISSION_GRANTED) {

As you can see it requires the android.permission.GET_ACCOUNTS permission. If you run the app on an device with Android 11 or later please note that you need to add additional attributes to the Manifest (see https://github.com/nextcloud/Android-SingleSignOn#1-add-this-library-to-your-project)

If that doesn't fix your issue please let me know which device you are testing this on (Brand / OS / etc.)

@stefan-niedermann
Copy link
Member

Closing due to missing feedback. @Andrewerr please feel free to reopen this or create a new issue in case Davids answer wasn't enough 🙂.

@0xf104a
Copy link
Author

0xf104a commented Nov 18, 2021

Sorry for long response. The library works correctly on Android versions from 8.1 to 11, while fails to work on Android 7.1.2, despite the permission

<uses-permission android:name="android.permission.GET_ACCOUNTS" /> 

which is as I mentioned added to manifest.

@0xf104a

This comment has been minimized.

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

No branches or pull requests

3 participants