简体   繁体   English

使用清单权限自动获取身份验证令牌

[英]Getting auth token automatically using the manifest permissions

I try to access Google Drive from an Android application. 我尝试从Android应用程序访问Google云端硬盘。 I use the getAuthToken method and it's working fine. 我使用getAuthToken方法,并且工作正常。 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. 例如, Google云端硬盘应用程序可以做到这一点。 This application can access my Google Drive and it didn't display dialogs to validate permission requests. 该应用程序可以访问我的Google云端硬盘,并且没有显示用于验证权限请求的对话框。 Looking at the permissions used in the AndroidManifest.xml, one can find: 查看AndroidManifest.xml中使用的权限,可以找到:

<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? 还是这些许可严格用于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. 最好的解决方案似乎显示权限请求对话框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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