Android-SingleSignOn icon indicating copy to clipboard operation
Android-SingleSignOn copied to clipboard

Account access permissions

Open 0xf104a opened this issue 4 years ago • 4 comments

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!

0xf104a avatar Oct 05 '21 11:10 0xf104a

@Andrewerr Sorry for the delay - I am currently on vacation and I didn't see this earlier. The log entry is written here: https://github.com/nextcloud/Android-SingleSignOn/blob/8047a9c3391ef78ef5a5c23d4a323378242ab081/src/main/java/com/nextcloud/android/sso/AccountImporter.java#L122

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.)

David-Development avatar Oct 19 '21 16:10 David-Development

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

stefan-niedermann avatar Nov 06 '21 11:11 stefan-niedermann

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 avatar Nov 18 '21 18:11 0xf104a

@stefan-niedermann Unfortunately I unable to reopen issue. The button Reopen issue is not displayed. It seems that I have got no reopening permissions in this repository :(

0xf104a avatar Nov 18 '21 18:11 0xf104a