-2

i have successfully setup ODK Collect into my android app. I can setup my tom cat credentials easily from the settings xml. However when i try to switch to google drive, i need to setup the google account from my phone. Is it possible to setin default email and password for fetching questionaires.

<string-array name="protocol_entry_values">
    <item>@string/protocol_odk_default</item>
    <item>@string/protocol_google_sheets</item>
    <item>@string/protocol_other</item>
</string-array>
<string-array name="protocol_entries">
    <item>@string/server_platform_odk_aggregate</item>
    <item>@string/server_platform_google_sheets</item>
    <item>@string/server_platform_other</item>
</string-array>
Isaac Obella
  • 2,613
  • 2
  • 16
  • 29
  • You should be reading the users permissions from the sign in not asking them to set a login and password. Google does not allow for client login anymore your going to have to Authenticate your users. – Linda Lawton - DaImTo Feb 26 '18 at 09:56
  • So i have a normal auth for my users, however have setup a google drive account that contains my xml forms for my users. However to be able to access these forms from google-drive. Each user has to signin to the gmail account that contains the forms. I was wondering if it was possible for me to authorize ODK collect to fetch these forms from google-drive without having my users manually setup the google account to connect them to google-drive. – Isaac Obella Feb 28 '18 at 15:59
  • are all the users going to be useing the same files? – Linda Lawton - DaImTo Feb 28 '18 at 16:11
  • Yes, i'll have a parent google account where all xml questionaires are stored – Isaac Obella Feb 28 '18 at 16:27
  • check out service accounts then sounds like this may be a good fit – Linda Lawton - DaImTo Feb 28 '18 at 16:33
  • Ok thanks let me check that & see if it works for me – Isaac Obella Feb 28 '18 at 16:36
  • 1
    Just read the documentation and seems like a great fit for what i'm trying to archive thanks alot – Isaac Obella Feb 28 '18 at 16:40

1 Answers1

1

If you are trying to access users google drive accounts files stored on that then you need to use Oauth2.

However if you are trying to access a central google drive account one that you as the developer has controller over you should look into service accounts. Service accounts are like a dummy user it has its own drive account and you can share a folder on your drive account with it. Its pre authorized so it always has access you dont have to worry about authenticating it.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449