简体   繁体   中英

Getting auth token automatically using the manifest permissions

I try to access Google Drive from an Android application. I use the getAuthToken method and it's working fine. The user must validate a dialog the first time it will use the application.

However, I wonder whether it would be possible to use the permissions at the installation of the application. For instance, the Google Drive application can do that. This application can access my Google Drive and it didn't display dialogs to validate permission requests. Looking at the permissions used in the AndroidManifest.xml, one can find:

<uses-permission android:name="com.google.android.gm.permission.READ_GMAIL"/>
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH"/>
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES"/>
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES"/>
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.writely"/>
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.wise"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

I didn't find much information about these permissions , but is it possible to use such permissions to not have to seek validation from the user? Or are these kinds of permission strictly for Google Apps?

Thank you in advance

It appears that it is not possible to do that. A nice answer can be found here . The best solution seems to display the permission request dialog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM