8
votes

I am developing application which is required to upload file into Google Drive. I started learning API from following link. https://developers.google.com/drive/ios/quickstart

Currently,I have to login first time for upload file. But in my application, every time there is same account will be used for uploading file. So, is there any way by which I can bypass GTMOAuth2ViewControllerTouch (login screen).

Please help me. I will be very thankful for your replay.

1
If you use the GTMOAuth2ViewControllerTouch method initWithScope: clientID:clientSecret:keychainItemName:delegate:finishedSelector:, and provide values for each, the login credentials should be stored in the user's iOS keychain, until such time that it is removed. Have you looked into implementing this method?andrewbuilder
Currently I am using same as you told. It is working fine. It shows me login screen first time. But I don't want Login Screen to authenticate . Is there any option to authenticate without showing login screen ?Bulla
Good question, unfortunately I am awaiting a similar response... see my question about programmatic authentication for webContentLink. Sorry Bulla. If I figure it out I'll let you know.andrewbuilder
Then I am waiting for your reply..Bulla
Assuming I understand what you mean by "every time there is same account". Which I took to mean you are only uploading to one account, NOT the logged in users account. You should look into using a service account.DaImTo

1 Answers

0
votes

Most Google APIs currently require an OAuth 2 token, and so far that is available only via the user-directed sign-in flow, which is what gtm-oauth2 provides.Some older Google APIs do support the ClientLogin protocol, in which the username and password are supplied directly by the application, but the newer APIs do not.

Remember that hardcoding any account authorization(especially an account password) into an application's binary is a security risk and is poor practice.