Rohit
Rohit

Reputation: 7161

Which Google Oauth 2.0 Client ID type choose for cordova hybrid mobile apps?

I am developing cordova based hybrid mobile apps targeted for android and iOS smartphones.

Usecase: The application authenticate user and then would be accessing Google Calendar API's, and finally display user events on the app.

Note: I will be Using 3-legged OAuth and Google Data APIs without the client libraries.

Question

The Cordova-enabled WebView provides the application with its entire user interface, so what should be the application type in this case?

OR

Please suggest what should be the proper approach to choose application type in this case.

Thanks!

enter image description here

Upvotes: 7

Views: 738

Answers (1)

anothermh
anothermh

Reputation: 10546

It depends on how your app is setup. If you plan on handling all of the OAUTH processing on a backend server then you can use the Web application type, and you can have all the OAUTH work offloaded to the backend server.

If you do not have a backend server and will do all OAUTH processing on the user's device, then you should create both an iOS and Android client ID. For example:

https://github.com/EddyVerbruggen/cordova-plugin-googleplus

This plugin's documentation shows the creation of both an iOS and Android client ID to enable Google Sign In on a Cordova app.

Upvotes: 2

Related Questions