Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/couragecowardlydog/ionic-google-auth
Ionic 3 native Google plus plugin Implementation
https://github.com/couragecowardlydog/ionic-google-auth
andorid angular authentication google-api google-api-client-library googleplus googleplus-profile ionic ionic-android ionic-apps ionic-auth ionic-cordova ionic-framework ionic-ios ionic-native ionic-plugin ionic2 ionic2-examples ios oauth2
Last synced: 5 days ago
JSON representation
Ionic 3 native Google plus plugin Implementation
- Host: GitHub
- URL: https://github.com/couragecowardlydog/ionic-google-auth
- Owner: couragecowardlydog
- Created: 2018-08-09T15:57:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T05:48:45.000Z (over 6 years ago)
- Last Synced: 2024-11-23T04:33:48.775Z (2 months ago)
- Topics: andorid, angular, authentication, google-api, google-api-client-library, googleplus, googleplus-profile, ionic, ionic-android, ionic-apps, ionic-auth, ionic-cordova, ionic-framework, ionic-ios, ionic-native, ionic-plugin, ionic2, ionic2-examples, ios, oauth2
- Language: TypeScript
- Size: 9.08 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google+ Auth - Ionic Implementation
As I wanted to integrate Google+ Auth in one my project, I started searching out documentation and tutorials for Google+ Auth Ionic Implementation. Unfortunately there is no proper documentation or tutorial to guide integration properly. Since I dont want any one to waste time on google, I made a small standalone implementationIf you want to integrate on existing Ionic App , use this command to retrive the SHA-1 KEY
`keytool -exportcert -keystore D:\Personal\ionic-google-auth\gauth.keystore -list -v`
Here `D:\Personal\ionic-google-auth\gauth.keystore` is path to my keystoreIf you want to integrate on a new project, make sure you always test with signed APK , use the following command to generate SIGNED CERTIFICATE
`keytool -genkey -v -keystore gauth.keystore -alias gauth -keyalg RSA -keysize 2048 -validity 100000`
With SHA-1 KEY Obtained from the previous step , navigate to https://console.developers.google.com/apis/dashboard and enable `Google+ API
`Next move is to create credentials , https://console.developers.google.com/apis/credentials
Click on `Create Credentials` to create a OAuth Client ID . Use the retrived `SHA-1 signing-certificate fingerprint` and your `package name` in config.xml to complete the step
![](https://github.com/VivekanandanS/ionic-google-auth/blob/master/src/assets/imgs/googel.png)
Once you completed this you'll get client ID, now you can process to ionic implementation.
`ionic cordova plugin add cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=myreversedclientid `
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 Google Developer's Console, this will be: "com.googleusercontent.apps.uniqueId", without quotes. Example: '123-abc123.apps.googleusercontent.com' becomes 'com.googleusercontent.apps.123-abc123'.
Now all its done, play with your code . Make sure you always build and test with signed apk. So that you dont need to update SHA-1 Certificate of your APK everytime in the console
GAuth | GAuth
:-------------------------:|:-------------------------:
![](https://github.com/VivekanandanS/ionic-google-auth/blob/master/src/assets/imgs/1.png) | ![](https://github.com/VivekanandanS/ionic-google-auth/blob/master/src/assets/imgs/2.png)GAuth | GAuth
:-------------------------:|:-------------------------:
![](https://github.com/VivekanandanS/ionic-google-auth/blob/master/src/assets/imgs/3.png) | ![](https://github.com/VivekanandanS/ionic-google-auth/blob/master/src/assets/imgs/4.png)