{"id":15097029,"url":"https://github.com/eddyverbruggen/cordova-plugin-googleplus","last_synced_at":"2025-10-08T02:30:50.006Z","repository":{"id":19077851,"uuid":"22305164","full_name":"EddyVerbruggen/cordova-plugin-googleplus","owner":"EddyVerbruggen","description":":heavy_plus_sign: Cordova plugin to login with Google Sign-In on iOS and Android","archived":true,"fork":false,"pushed_at":"2023-05-04T17:33:33.000Z","size":25559,"stargazers_count":567,"open_issues_count":395,"forks_count":626,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-08-09T03:42:48.778Z","etag":null,"topics":["cordova","google-sign","google-sign-in","phonegap"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EddyVerbruggen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-07-27T06:45:59.000Z","updated_at":"2025-07-18T08:53:54.000Z","dependencies_parsed_at":"2022-07-23T12:16:59.028Z","dependency_job_id":"25f150fb-b482-42d9-b6ac-e2ddb71ff765","html_url":"https://github.com/EddyVerbruggen/cordova-plugin-googleplus","commit_stats":{"total_commits":220,"total_committers":67,"mean_commits":3.283582089552239,"dds":0.5272727272727273,"last_synced_commit":"dd5f7921c9bd3b348717ceda66895fac4a3ebcf1"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/EddyVerbruggen/cordova-plugin-googleplus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fcordova-plugin-googleplus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fcordova-plugin-googleplus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fcordova-plugin-googleplus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fcordova-plugin-googleplus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EddyVerbruggen","download_url":"https://codeload.github.com/EddyVerbruggen/cordova-plugin-googleplus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fcordova-plugin-googleplus/sbom","scorecard":{"id":44164,"data":{"date":"2025-08-11","repo":{"name":"github.com/EddyVerbruggen/cordova-plugin-googleplus","commit":"dd5f7921c9bd3b348717ceda66895fac4a3ebcf1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":5,"reason":"Found 10/18 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T22:19:25.367Z","repository_id":19077851,"created_at":"2025-08-14T22:19:25.367Z","updated_at":"2025-08-14T22:19:25.367Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278877516,"owners_count":26061458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cordova","google-sign","google-sign-in","phonegap"],"created_at":"2024-09-25T16:03:46.565Z","updated_at":"2025-10-08T02:30:49.654Z","avatar_url":"https://github.com/EddyVerbruggen.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Sign-In Cordova/PhoneGap Plugin\n\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n[![Twitter Follow][twitter-image]][twitter-url]\n\n[build-status]:https://travis-ci.org/EddyVerbruggen/cordova-plugin-googleplus.svg?branch=master\n[build-url]:https://travis-ci.org/EddyVerbruggen/cordova-plugin-googleplus\n[npm-image]:http://img.shields.io/npm/v/cordova-plugin-googleplus.svg\n[npm-url]:https://npmjs.org/package/cordova-plugin-googleplus\n[downloads-image]:http://img.shields.io/npm/dm/cordova-plugin-googleplus.svg\n[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social\u0026label=Follow%20me\n[twitter-url]:https://twitter.com/eddyverbruggen\n\n\u003e ⚠️ From plugin version 6.0.0 the minimum required cordova-ios version is 4.5.0. Need to use a lower cordova-ios version? Use plugin version 5.3.2 or lower.\n\n## 0. Index\n\n1. [Description](#1-description)\n2. [Screenshots](#2-screenshots)\n3. [Google API setup](#3-google-api-setup)\n4. [Installation (CLI / Plugman)](#4-installation-phonegap-cli--cordova-cli)\n5. [Installation (PhoneGap Build)](#5-installation-phonegap-build)\n6. [Installation (iOS and Cocoapods)](#6-installation-ios-and-cocoapods)\n7. [Usage](#7-usage)\n8. [Exchanging the `idToken`](#8-exchanging-the-idtoken)\n9. [Exchanging the `serverAuthCode`](#9-exchanging-the-serverauthcode)\n10. [Troubleshooting](#10-troubleshooting)\n11. [Changelog](#11-changelog)\n\n## 1. Description\n\nThis plugin allows you to authenticate and identify users with [Google Sign-In](https://developers.google.com/identity/) on [iOS](https://developers.google.com/identity/sign-in/ios/) and [Android](https://developers.google.com/identity/sign-in/android/).\nOut of the box, you'll get email, display name, given name, family name, profile picture url, and user id.\nYou can also configure it to get an [idToken](#7-exchanging-the-idtoken) and [serverAuthCode](#8-exchanging-the-serverauthcode).\n\nThis plugin only wraps access to the Google Sign-In API. Further API access should be implemented per use-case, per developer.\n\n## 2. Screenshots\n\nAndroid\n\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/cordova-plugin-googleplus/master/screenshots/Android1.png\" width=\"235\" height=\"400\"/\u003e\u0026nbsp;\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/cordova-plugin-googleplus/master/screenshots/Android2.png\" width=\"235\" height=\"400\"/\u003e\u0026nbsp;\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/cordova-plugin-googleplus/master/screenshots/Android3.png\" width=\"235\" height=\"400\"/\u003e\n\n iOS\n\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/cordova-plugin-googleplus/master/screenshots/iOS1.png\" width=\"235\" height=\"417\"/\u003e\u0026nbsp;\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/cordova-plugin-googleplus/master/screenshots/iOS2.png\" width=\"235\" height=\"417\"/\u003e\u0026nbsp;\n\u003cimg src=\"https://raw.githubusercontent.com/EddyVerbruggen/cordova-plugin-googleplus/master/screenshots/iOS3.png\" width=\"235\" height=\"417\"/\u003e\u0026nbsp;\n\n## 3. Google API setup\nTo communicate with Google you need to do some tedious setup, sorry.\n\nIt is (strongly) recommended that you use the same project for both iOS and Android.\n\n### Before you proceed\nGo into your `config.xml` and make sure that your package name (i.e. the app ID) is what you want it to be. Use this package name when setting up iOS and Android in the following steps! If you don't, you will likely get a 12501, 'user cancelled' error despite never cancelling the log in process.\n\nThis step is _especially_ important if you are using a framework such as Ionic to scaffold out your project. When you create the project, the `config.xml` has a placeholder packagename, e.g. com.ionic.*, so you can start developing right away.\n\n```xml\n\u003c?xml version='1.0' encoding='utf-8'?\u003e\n\u003cwidget id=\"** REPLACE THIS VALUE **\" ...\u003e\n...\n\u003c/widget\u003e\n```\n\n### Browser\nBrowser platform require a valid `WEB_APPLICATION_CLIENT_ID` that generated at [Google Developer Console](https://console.developers.google.com/).\nEnsure you have added your url address (example: `http://localhost:3000`) to **Authorized JavaScript origins** section.\nSee [this screenshot for example](http://pix.toile-libre.org/upload/original/1508064473.png)\n\n### iOS\nTo get your iOS `REVERSED_CLIENT_ID`, [generate a configuration file here](https://developers.google.com/mobile/add?platform=ios\u0026cntapi=signin).\nThis `GoogleService-Info.plist` file contains the `REVERSED_CLIENT_ID` you'll need during installation. _This value is only needed for iOS._\n\nThe `REVERSED_CLIENT_ID` is also known as the \"iOS URL Scheme\" on the Developer's Console.\n\nLogin on iOS takes the user to a [SafariViewController](https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/) through the Google SDK, instead of the separate Safari browser.\n\n### Android\nTo configure Android, [generate a configuration file here](https://developers.google.com/mobile/add?platform=android\u0026cntapi=signin). Enable Google Sign-In and add an Android App to add the SHA1 fingerprint. Once Google Sign-In is enabled Google will automatically create necessary credentials in Developer Console for web and Android. There is no need to add the generated google-services.json file into your cordova project. You may need to configure the consent screen.\n\nMake sure you execute the `keytool` steps as explained [here](https://developers.google.com/drive/android/auth) or authentication will fail (do this for both release and debug keystores).\n\nIMPORTANT:\n* The step above, about `keytool`, show 2 types of certificate fingerprints, the **Release** and the **Debug**, when generating the configuration file, it's better to use the **Debug** certificate fingerprint, after that, you have to go on [Google Credentials Manager](https://console.developers.google.com/apis/credentials), and manually create a credential for **OAuth2 client** with your **Release** certificate fingerprint. This is necessary to your application work on both Development and Production releases.\n* Ensure that you are using the correct alias name while generating the fingerprint.\n```\n$ keytool -exportcert -keystore \u003cpath-to-debug-or-production-keystore\u003e -list -v -alias \u003calias-name\u003e\n```\nLogin on Android will use the accounts signed in on the user's device.\n\n#### Integrating Google Play Services\n\nTo set up Google Play Services version, you can use PLAY_SERVICES_VERSION parameter (with 11.8.0 value by default). It is useful in order to avoid conflicts with another plugins which use any other different version of Google Play Service, because they MUST be the same version.\n\n#### Publishing your app in Google Play Store\n\nGoogle re-signs your app with a different certificate when you publish it in the Play Store. Once your app is published, copy the SHA-1 fingerprint of the \"App signing certificate\", found in the \"App signing\" section under \"Release Management\", in [Google Play Console](https://play.google.com/apps/publish/). Paste this fingerprint in the Release OAuth client ID in [Google Credentials Manager](https://console.developers.google.com/apis/credentials).\n\n### Web Client Id\n\nIf you want to get an `idToken` or `serverAuthCode` back from the Sign In Process, you will need to pass the client ID for your project's web application. This can be found on your project's API credentials page on the [Google Developer's Console](https://console.developers.google.com/).\n\n## 4. Installation (PhoneGap CLI / Cordova CLI)\nThis plugin is compatible with:\n* [Cordova Plugman](https://github.com/apache/cordova-plugman)\n* [PhoneGap 3.0 CLI](http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface_add_features)\n* [Ionic](http://ionic.io/) ***(must use the Cordova CLI)***\n* [Meteor JS](https://atmospherejs.com/hedcet/cordova-google-plus-native-sign-in)\n\nHere's how it works (backup your project first!):\n\nUsing the Cordova CLI and [npm](https://www.npmjs.com/package/cordova-plugin-googleplus):\n```\n$ cordova plugin add cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=myreversedclientid --variable WEB_APPLICATION_CLIENT_ID=mywebapplicationclientid\n$ cordova prepare\n```\n\nUsing the Cordova CLI to fetch the latest version from GitHub:\n```\n$ cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=myreversedclientid  --variable WEB_APPLICATION_CLIENT_ID=mywebapplicationclientid\n$ cordova prepare\n```\n\nIMPORTANT:\n\n* _Please note that `myreversedclientid` is a place holder for the reversed clientId you find in your iOS configuration file. Do not surround this value with quotes. **(iOS only Applications)**_\n\n* _If you are building a hybrid application **(iOS and Android)**, or an Android application, you have to replace `myreversedclientid` with the reverse value of Client ID in your **Release** credential generated on step 3, on [Google Developer's Console](https://console.developers.google.com/), this will be: **\"com.googleusercontent.apps.`uniqueId`\"**, without quotes. Example: '123-abc123.apps.googleusercontent.com' becomes 'com.googleusercontent.apps.123-abc123'._\n\n* `myreversedclientid` is a place holder for Oauth Client ID specifically generated for web application in your [Google Developer's Console](https://console.developers.google.com/).\n\nGooglePlus.js is brought in automatically. There is no need to change or add anything in your html.\n\n## 5. Installation (PhoneGap Build)\nAdd this to your config.xml:\n\nFor the (stable) NPM Version:\n```xml\n\u003cplugin name=\"cordova-plugin-googleplus\" source=\"npm\"\u003e\n  \u003cvariable name=\"REVERSED_CLIENT_ID\" value=\"myreversedclientid\" /\u003e\n  \u003cvariable name=\"WEB_APPLICATION_CLIENT_ID\" value=\"mywebapplicationclientid\" /\u003e\n\u003c/plugin\u003e\n```\n\nFor the latest version from Git (not recommended):\n```xml\n\u003cplugin spec=\"https://github.com/EddyVerbruggen/cordova-plugin-googleplus.git\" source=\"git\"\u003e\n  \u003cvariable name=\"REVERSED_CLIENT_ID\" value=\"myreversedclientid\" /\u003e\n  \u003cvariable name=\"WEB_APPLICATION_CLIENT_ID\" value=\"mywebapplicationclientid\" /\u003e\n\u003cplugin\u003e\n```\n\n## 6. Installation (iOS and Cocoapods)\n\nThis plugin use the [CocoaPods dependency manager](https://cocoapods.org) in order to satisfy the iOS Google SignIn SDK library dependencies.\n\nTherefore please make sure you have Cocoapods installed in your iOS build environment - setup instructions can be found [here](https://cocoapods.org/). Also make sure your local Cocoapods repo is up-to-date by running `pod repo update`.\n\nIf building your project in Xcode, you need to open `YourProject.xcworkspace` (not `YourProject.xcodeproj`) so both your Cordova app project and the Pods project will be loaded into Xcode.\n\nYou can list the pod dependencies in your Cordova iOS project by installing [cocoapods-dependencies](https://github.com/segiddins/cocoapods-dependencies):\n\n```\nsudo gem install cocoapods-dependencies\ncd platforms/ios/\npod dependencies\n```\n\n## 7. Usage\nCheck the [demo app](demo) to get you going quickly, or hurt yourself and follow these steps.\n\nNote that none of these methods should be called before [`deviceready`](https://cordova.apache.org/docs/en/latest/cordova/events/events.deviceready.html) has fired.\n\nExample:\n```javascript\ndocument.addEventListener('deviceready', deviceReady, false);\n\nfunction deviceReady() {\n    //I get called when everything's ready for the plugin to be called!\n    console.log('Device is ready!');\n    window.plugins.googleplus.trySilentLogin(...);\n}\n```\n\n### isAvailable\n3/31/16: This method is no longer required to be checked first. It is kept for code orthoganality.\n\n### Login\n\nThe login function walks the user through the Google Auth process. All parameters are optional, however there are a few caveats.\n\nTo get an `idToken` on Android, you ***must*** pass in your `webClientId` (a frequent mistake is to supply Android Client ID). On iOS, the `idToken` is included in the sign in result by default.\n\nTo get a `serverAuthCode`, you must pass in your `webClientId` _and_ set `offline` to true. If offline is true, but no webClientId is provided, the `serverAuthCode` will _**NOT**_ be requested.\n\nThe default scopes requested are `profile` and `email` (always requested). To request other scopes, add them as a **space-separated list** to the `scopes` parameter. They will be requested exactly as passed in. Refer to the [Google Scopes](https://developers.google.com/identity/protocols/googlescopes) documentation for info on valid scopes that can be requested. For example, `'scope': 'https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/tasks'`.\n\nNaturally, in order to use any additional scopes or APIs, they will need to be activated in your project Developer's Console.\n\n##### Usage\n```javascript\nwindow.plugins.googleplus.login(\n    {\n      'scopes': '... ', // optional, space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.\n      'webClientId': 'client id of the web app/server side', // optional clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.\n      'offline': true // optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server\n    },\n    function (obj) {\n      alert(JSON.stringify(obj)); // do something useful instead of alerting\n    },\n    function (msg) {\n      alert('error: ' + msg);\n    }\n);\n```\n\nThe success callback (second argument) gets a JSON object with the following contents, with example data of my Google account:\n```javascript\n obj.email          // 'eddyverbruggen@gmail.com'\n obj.userId         // user id\n obj.displayName    // 'Eddy Verbruggen'\n obj.familyName     // 'Verbruggen'\n obj.givenName      // 'Eddy'\n obj.imageUrl       // 'http://link-to-my-profilepic.google.com'\n obj.idToken        // idToken that can be exchanged to verify user identity.\n obj.serverAuthCode // Auth code that can be exchanged for an access token and refresh token for offline access\n obj.accessToken    // OAuth2 access token\n```\n\nAdditional user information is available by use case. Add the scopes needed to the scopes option then return the info to the result object being created in the `handleSignInResult` and `didSignInForUser` functions on Android and iOS, respectively.\n\nOn Android, the error callback (third argument) receives an error status code if authentication was not successful. A description of those status codes can be found on Google's android developer website at [GoogleSignInStatusCodes](https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes).\n\nOn iOS, the error callback will include an [NSError localizedDescription](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSError_Class/).\n\n### Try silent login\nYou can call `trySilentLogin` to check if they're already signed in to the app and sign them in silently if they are.\n\nIf it succeeds you will get the same object as the `login` function gets,\nbut if it fails it will not show the authentication dialog to the user.\n\nCalling `trySilentLogin` is done the same as `login`, except for the function name.\n```javascript\nwindow.plugins.googleplus.trySilentLogin(\n    {\n      'scopes': '... ', // optional - space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.\n      'webClientId': 'client id of the web app/server side', // optional - clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.\n      'offline': true, // Optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server\n    },\n    function (obj) {\n      alert(JSON.stringify(obj)); // do something useful instead of alerting\n    },\n    function (msg) {\n      alert('error: ' + msg);\n    }\n);\n```\n\nIt is strongly recommended that trySilentLogin is implemented with the same options as login, to avoid any potential complications.\n\n### logout\nThis will clear the OAuth2 token.\n``` javascript\nwindow.plugins.googleplus.logout(\n    function (msg) {\n      alert(msg); // do something useful instead of alerting\n    }\n);\n```\n\n### disconnect\nThis will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.\n``` javascript\nwindow.plugins.googleplus.disconnect(\n    function (msg) {\n      alert(msg); // do something useful instead of alerting\n    }\n);\n```\n\n## 8. Exchanging the `idToken`\n\nGoogle Documentation for Authenticating with a Backend Server\n- [Web](https://developers.google.com/identity/sign-in/web/backend-auth)\n- [Android](https://developers.google.com/identity/sign-in/android/backend-auth)\n- [iOS](https://developers.google.com/identity/sign-in/ios/backend-auth)\n\nAs the above articles mention, the `idToken` can be exchanged for user information to confirm the users identity.\n\n_Note: Google does not want user identity data sent directly to a server. The idToken is their preferred method to send that data securely and safely, as it must be verified through their servers in order to unpack._\n\nThis has several uses. On the client-side, it can be a way to get doubly confirm the user identity, or it can be used to get details such as the email host domain. The server-side is where the `idToken` really hits its stride. It is an easy way to confirm the users identity before allowing them access to that servers resources or before exchanging the `serverAuthCode` for an access and refresh token (see the next section).\n\nIf your server-side only needs identity, and not additional account access, this is a secure and simple way to supply that information.\n\n## 9. Exchanging the `serverAuthCode`\n\nGoogle Documentation for Enabling Server-Side Access\n- [Web](https://developers.google.com/identity/protocols/OAuth2WebServer#handlingresponse)\n- [Android](https://developers.google.com/identity/sign-in/android/offline-access)\n- [iOS](https://developers.google.com/identity/sign-in/ios/offline-access)\n\nAs the above articles mention, the `serverAuthCode` is an item that can be exchanged for an access and refresh token. Unlike the `idToken`, this allows the server-side to have direct access to the users Google account.\n\nOnly in the initial login request `serverAuthCode` will be returned. If you wish to receive the token a second time, you can by using logout first.\n\nYou have a couple options when it comes to this exchange: you can use the Google REST Apis to get those in the hybrid app itself or you can send the code to your backend server to be exchanged there, using whatever method necessary (Google provides examples for Java, Python, and JS/HTTP).\n\nAs stated before, this plugin is all about user authentication and identity, so any use of the user's account beyond that needs to be implemented per use case, per application.\n\n## 10. Troubleshooting\n- Q: I can't get authentication to work on Android. And why is there no ANDROID API KEY?\n- A: On Android you need to execute the `keytool` steps, see the installation instructions for details.\n\n- Q: After following the `keytool` steps, I still can't get authentication to work on Android. I'm having a \"10 error\"!!!\n- A: You need to get the SHA 1 cert from your apk file. Run: `keytool -list -printcert -jarfile \u003cyour apk\u003e` and copy the SHA 1 to your Android Client ID on Google Console.\n\n- Q: OMG $@#*! the Android build is failing\n- A: You need to have _Android Support Repository_ and _Android Support Library_ installed in the Android SDK manager. Make sure you're using a fairly up to date version of those.\n\n- Q: Why isn't this working on my Android Emulator???\n- A: Make sure you are using a Virtual Device running with a **Google APIs target and/or a Google APIs CPU**!\n\n- Q: I'm getting **Error 10**, what do I do?\n- A: This is likely caused by cordova not using the keystore you want to use (e.g. because you generated your own). Please check https://cordova.apache.org/docs/en/latest/guide/platforms/android/#signing-an-app to read how to do this. Some have reported that you need to run `cordova clean` before running the build to resolve error 10.\n\n- Q: I'm getting **Error 16**, what do I do?\n- A: This is always a problem because the signature (or fingerprint) of your android app when signed is not added to the google console (or firebase) OAuth whitelist. Please double check if you did everything required for this. See the mini-guide below.\n\n### Error 16 \u0026 app signing mini-guide\n\nFirst, make sure you fully read and understand the [guide on App Signing from the android documentation](https://developer.android.com/studio/publish/app-signing)!\n\nAfter/while reading that, double check if you did all steps 1-4 below correctly:\n\n#### 1. Make a keystore\n\nIn order to sign your app (on dev or publish) you will need to make a local keystore and key with Android Studio or via terminal. Google has a feature called \"Google Play App Signing\" where they will keep the key on their server and sign your app for you, but if you use this feature or not, **you will need a local keystore and key either way.**\n\n- If you do not use \"Google Play App Signing\" → go to 3A\n- If you _do_ use \"Google Play App Signing\" → go to 3B\n\n#### 2A. Without _Google Play App Signing_\n\nYour local keystore and key will be your official app signing key.\n\nYou will need to whitelist the following key fingerprints (in SHA1 format) in Google OAuth settings:\n\n- android default `debug.keystore` key\n- your own created keystore with its key (for App Signing)\n\n#### 2B. With _Google Play App Signing_ enabled\n\nYour local keystore and key will be your \"Upload key\" and another key for official \"App Signing key\" is created and managed by Google.\n\nYou need to whitelist the following key fingerprints (in SHA1 format) in Google Oauth settings:\n\n- android default `debug.keystore` key\n- your own created keystore with its key (for Uploading)\n- google's App Signing key\n\n#### 3. Get key fingerprints\n\nGet the above keys' fingerprints (in SHA1 format) to be able to whitelist them.\n\n#### A. Debug key\n\nFor the android default `debug.keystore` do:\n\n    keytool -exportcert -keystore /Users/myusername/.android/debug.keystore  -list -v\n\nYou will see the SHA1 fingerprint for the debug key in terminal. Copy that.\n\n#### B. App signing or Upload key\n\nFor the own created keystore with key (either for 2A or 2B) do:\n\n    keytool -exportcert -keystore /path/to/your/key/yourKeystoreFile.keystore  -list -v\n\nYou will see the SHA1 fingerprint for the debug key in terminal. Copy that.\n\n#### C. Google's App signing key\n\nOnly when _Google Play App Signing_ is enabled (for 2B). You can find the key Google will use to sign your builds in the Google Play Console.\n\n_Requirement:_ You need to have finished the basic info on your android app and then you need to upload a signed APK for internal testing. Once this is uploaded you will be able to access the following menu:\n\nGo to Release Management \u003e App sigining. There you will see\n\n- \"App signing certificate\" and SHA-1 fingerprint\n- \"Upload certificate\" and SHA-1 fingerprint\n\nThe \"Upload\" one is (and should be) the same as key B. above. And the \"App signing certificate\" is the key that Google will use. Copy this one.\n\n#### 4. Whitelist the key fingerprints\n\nAgain we have 2 options to whitelist them. Projects that use only the _Google Cloud Platform_ or projects that use _Firebase_.\n\n#### A. Google Cloud Platform projects\n\n(In case you also use Firebase, you can skip this step)\n\n1. Go to [API \u0026 Services \u003e credentials](https://console.cloud.google.com/apis/credentials)\n2. Create credentials \u003e OAuth client ID\n3. choose \"android\" and insert your SHA1\n4. Repeat this for all keys (2 or 3)\n\n#### B. Firebase projects\n\n1. Go to the console \u003e Projects settings\n2. Select your Android app at the bottom. (if you don't have any, add an android app, you can ignore the whole tutorial they give you, it's irrelevant for Cordova apps)\n3. Add the finger prints to the \"SHA certificate fingerprints\" section.\n4. Double check your Google Cloud console: [API \u0026 Services \u003e credentials](https://console.cloud.google.com/apis/credentials) and see that Firebase has added these automatically at the bottom under \"OAuth 2.0 client IDs\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fcordova-plugin-googleplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddyverbruggen%2Fcordova-plugin-googleplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fcordova-plugin-googleplus/lists"}