Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

  • Since everything is going inside webview, so Shall I choose "Web Application"?

OR

  • Do I need to create seperate Applications type for Android and iOS seperately?

  • Or can iOS Application Type work for both Android and iOS?

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

Thanks!

enter image description here

like image 222
Rohit Avatar asked Mar 22 '17 07:03

Rohit


1 Answers

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.

like image 177
anothermh Avatar answered Oct 08 '22 15:10

anothermh