Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Include a token on the response so the user can be authenticated server side #7

Closed
wants to merge 2 commits into from

Conversation

DanielOchoa
Copy link
Contributor

By returning an idToken on the results after signing in, we can now authenticate the user on the server as well. This is essential when using this plugin to create/validate users on an app that works with a backend.

So far I've made this modification for iOS only. I'll try and implement it on android as well.

@EddyVerbruggen
Copy link
Owner

Thank you very much @DanyHunter. Android would be very welcome as well, otherwise I can dive into that. I will merge this soon.

EddyVerbruggen added a commit that referenced this pull request Oct 23, 2014
EddyVerbruggen added a commit that referenced this pull request Oct 23, 2014
@DanielOchoa
Copy link
Contributor Author

You are welcome! Glad I could help. I'll have to set it up for Android eventually but until then feel free to jump in. 👍

shinyMetilda pushed a commit to shinyMetilda/cordova-plugin-googleplus that referenced this pull request Mar 22, 2016
shinyMetilda pushed a commit to shinyMetilda/cordova-plugin-googleplus that referenced this pull request Mar 22, 2016
pwbs pushed a commit to pwbs/cordova-plugin-googleplus that referenced this pull request Jun 27, 2017
# This is the 1st commit message:
# This is a combination of 3 commits.
# This is the 1st commit message:
# This is a combination of 2 commits.
# This is the 1st commit message:

# This is a combination of 2 commits.
# This is the 1st commit message:

# This is a combination of 2 commits.
# This is the 1st commit message:

# This is a combination of 2 commits.
# This is the 1st commit message:

# This is a combination of 7 commits.
# This is the 1st commit message:
# This is a combination of 3 commits.
# This is the 1st commit message:
# This is a combination of 3 commits.
# This is the 1st commit message:
# This is a combination of 2 commits.
# This is the 1st commit message:

# This is a combination of 6 commits.
# This is the 1st commit message:
# This is a combination of 10 commits.
# This is the 1st commit message:
Finished implementation

# The commit message EddyVerbruggen#2 will be skipped:

#	Attempt at some decent documentation

# The commit message EddyVerbruggen#3 will be skipped:

#	Attempt at some decent documentation

# The commit message EddyVerbruggen#4 will be skipped:

#	Added iOS screenshots

# The commit message EddyVerbruggen#5 will be skipped:

#	cleanup

# The commit message EddyVerbruggen#6 will be skipped:

#	Added a permission for Android preventing a crash on some devices

# The commit message EddyVerbruggen#7 will be skipped:

#	Cleanup

# The commit message EddyVerbruggen#8 will be skipped:

#	iOSApiKey is for iOS, not for Android :)

# The commit message EddyVerbruggen#9 will be skipped:

#	EddyVerbruggen#3 redirect url not handled when redirected from Google+ app on iOS

# The commit message EddyVerbruggen#10 will be skipped:

#	EddyVerbruggen#6 ADD Birthday and AgeRange

# The commit message EddyVerbruggen#1 will be skipped:

#	EddyVerbruggen#6 ADD Birthday and AgeRange (wasn't really happy with the PR, so I changed it a bit and added iOS support). Thanks for the help!

# The commit message EddyVerbruggen#2 will be skipped:

#	EddyVerbruggen#6 addtional checks on Android

# The commit message EddyVerbruggen#3 will be skipped:

#	Add userId property to let developer to get Google user ID for business logic.

# The commit message EddyVerbruggen#4 will be skipped:

#	EddyVerbruggen#7, needed to manually merge

# The commit message EddyVerbruggen#5 will be skipped:

#	EddyVerbruggen#7, needed additional flag

# The commit message EddyVerbruggen#6 will be skipped:

#	Missing dependency for iOS 8 SDK

# The commit message EddyVerbruggen#7 will be skipped:

#	Android - play services jar fixed version

# The commit message EddyVerbruggen#8 will be skipped:

#	Android playservices updated to 21

# The commit message EddyVerbruggen#9 will be skipped:

#	Update README.md
#
#	Fix typo. I believe this is for iOS only right now and not Android yet if I'm not mistaken.

# The commit message EddyVerbruggen#10 will be skipped:

#	A note about Android config

# The commit message EddyVerbruggen#1 will be skipped:

#	EddyVerbruggen#15 added troubleshooting section

# The commit message EddyVerbruggen#2 will be skipped:

#	Adding idToken to Android
#
#	Based on this gist [1] I'm adding support for getting the auth oauth2 token
#	that Google generates after the user accepts the login.
#
#	[1] https://gist.github.com/ianbarber/5170508

# The commit message EddyVerbruggen#3 will be skipped:

#	Introducing idToken and oauthToken
#
#	Allow the user to configure the service so any of the 3 possibles can be reached
#	when the user passes webApiKey in the credentials dictionary will get a JWT token
#	id, if androidApiKey is set in the credentials then an off-line capable oauth2
#	token bearer will be generated in the oauthToken value, while if no argument is
#	set a simple oauth2 token will get generated.

# The commit message EddyVerbruggen#4 will be skipped:

#	Adding extra necessary permissions

# The commit message EddyVerbruggen#5 will be skipped:

#	EddyVerbruggen#12 oauthToken for iOS

# The commit message EddyVerbruggen#6 will be skipped:

#	EddyVerbruggen#22 User-cancelled login on iOS - Neither the success nor error callbacks are called

# The commit message EddyVerbruggen#7 will be skipped:

#	EddyVerbruggen#26 Preparing submission to plugins.cordova.io

# The commit message EddyVerbruggen#8 will be skipped:

#	Prep plugin registry release (as tarball, to circumvent an npm symlink issue)

# The commit message EddyVerbruggen#9 will be skipped:

#	Added a warning about the current state of the plugman publish command

# The commit message EddyVerbruggen#10 will be skipped:

#	Removing the symlinks from iOS libs to be plugman (npm) publish compliant

# The commit message EddyVerbruggen#1 will be skipped:

#	Removing the symlinks from iOS libs to be plugman (npm) publish compliant

# The commit message EddyVerbruggen#2 will be skipped:

#	Removing the symlinks from iOS libs to be plugman (npm) publish compliant

# The commit message EddyVerbruggen#3 will be skipped:

#	Removing the symlinks from iOS libs to be plugman (npm) publish compliant

# The commit message EddyVerbruggen#4 will be skipped:

#	Removing the symlinks from iOS libs to be plugman (npm) publish compliant

# The commit message EddyVerbruggen#5 will be skipped:

#	Removing the symlinks from iOS libs to be plugman (npm) publish compliant

# The commit message EddyVerbruggen#6 will be skipped:

#	Removing the symlinks from iOS libs to be plugman (npm) publish compliant

# The commit message EddyVerbruggen#7 will be skipped:

#	Removing the symlinks from iOS libs to be plugman (npm) publish compliant

# The commit message EddyVerbruggen#8 will be skipped:

#	EddyVerbruggen#37 Google+ login using web browser is rejected on the App Store.

# The commit message EddyVerbruggen#9 will be skipped:

#	From Cordova 4 setActivityResultCallback is on CordovaInterfaceImpl

# The commit message EddyVerbruggen#10 will be skipped:

#	Not importing android-support-v4

# The commit message EddyVerbruggen#1 will be skipped:

#	EddyVerbruggen#45 login and trySilendLogin now return userdata on Android

# The commit message EddyVerbruggen#2 will be skipped:

#	Update plugin.xml

# The commit message EddyVerbruggen#3 will be skipped:

#	Update plugin.xml

# The commit message EddyVerbruggen#4 will be skipped:

#	EddyVerbruggen#56 new playservices version

# The commit message EddyVerbruggen#5 will be skipped:

#	npm

# The commit message EddyVerbruggen#6 will be skipped:

#	or not to npm..

# The commit message EddyVerbruggen#7 will be skipped:

#	replace deprecated dependency plugin

# The commit message EddyVerbruggen#8 will be skipped:

#	New ID, published to npm

# The commit message EddyVerbruggen#9 will be skipped:

#	New ID, published to npm

# The commit message EddyVerbruggen#10 will be skipped:

#	PGB note

# The commit message EddyVerbruggen#1 will be skipped:

#	Update dependencies to gradle format to fix EddyVerbruggen#64

# The commit message EddyVerbruggen#2 will be skipped:

#	bump

# The commit message EddyVerbruggen#3 will be skipped:

#	Switch to Google Sign-In SDK for iOS
#
#	This should fix Apple rejection from popping up Safari.
#	Will update README soon.
#	Update version to 3.0.0.

# The commit message EddyVerbruggen#4 will be skipped:

#	Allowed scope to be passed into signin

# The commit message EddyVerbruggen#5 will be skipped:

#	Attempt to fix offline screen

# The commit message EddyVerbruggen#6 will be skipped:

#	Cleanup for google plus connection with scopes and offline access

# The commit message EddyVerbruggen#7 will be skipped:

#	Fixed REVERSED_CLIENT_ID variable

# The commit message EddyVerbruggen#8 will be skipped:

#	Invalid quotes (according to my IDE)

# The commit message EddyVerbruggen#9 will be skipped:

#	Made ios use scopes

# The commit message EddyVerbruggen#10 will be skipped:

#	Added server auth code logic for ios

# The commit message EddyVerbruggen#1 will be skipped:

#	Made server auth code not throw a null reference

# The commit message EddyVerbruggen#2 will be skipped:

#	Plugin update to 4.0.0:
#	- Changed the ID to cordova-plugin-googleplus (again)
#	- Wider Android dependent fwk compatibility
#	- Documented scopes feature
#	- Removed the need for the iosApiKey

# The commit message EddyVerbruggen#3 will be skipped:

#	Fixed npm reference in doc

# The commit message EddyVerbruggen#4 will be skipped:

#	EddyVerbruggen#95 Crash when using isAvailable method before login

# The commit message EddyVerbruggen#5 will be skipped:

#	access_token fix for iOS
#
#	The access_token will now be returned as: accessToken

# The commit message EddyVerbruggen#6 will be skipped:

#	* generate both oauthToken and idToken

# The commit message EddyVerbruggen#7 will be skipped:

#	Added an "offline" parameter to enable getting a server auth token even without androidApiKey.

# The commit message EddyVerbruggen#8 will be skipped:

#	Added info to README about the API key for serverClientId.

# The commit message EddyVerbruggen#9 will be skipped:

#	Google decided to change a link without adding a nice redirect

# The commit message EddyVerbruggen#10 will be skipped:

#	Enabled getting serverAuthCode when the webApiKey param is set.

# The commit message EddyVerbruggen#2 will be skipped:

#	EddyVerbruggen#108 Added an option to generate access token for offline access on Android

# The commit message EddyVerbruggen#3 will be skipped:

#	EddyVerbruggen#82 Google Plus window not loading!
#	EddyVerbruggen#113 Not getting user extras (e.g. imageUrl) in callback object. Re-added imageUrl for iOS

# The commit message EddyVerbruggen#4 will be skipped:

#	Android: Ensure a new one time token on each login
#
#	When using the androidApiKey parameter a short-lived one time token
#	is generated, which can then be passed to the server where it can be
#	exchanged for a proper access and refresh token. Since all tokens get
#	cached by GoogleAuthUtil logging in a second time will cause the token
#	to be invalid if it was used before or some time has passed.

# The commit message EddyVerbruggen#5 will be skipped:

#	EddyVerbruggen#118 App Crash

# The commit message EddyVerbruggen#6 will be skipped:

#	EddyVerbruggen#147 Android fwk tags

# The commit message EddyVerbruggen#7 will be skipped:

#	Android 6.0
#
#	Added call to request permission

# The commit message EddyVerbruggen#8 will be skipped:

#	EddyVerbruggen#149 Android 6.0

# The commit message EddyVerbruggen#9 will be skipped:

#	IOS Build fails with compilation errors EddyVerbruggen#150

# The commit message EddyVerbruggen#10 will be skipped:

#	IOS Build fails with compilation errors EddyVerbruggen#150

# The commit message EddyVerbruggen#1 will be skipped:

#	Android: Gets a new offline token on each login
#
#	Based on EddyVerbruggen#119
#	I tested this on an app I'm working where every authentication attempt returned the same invalid token. After applying this change, the authentication works fine each time.

# The commit message EddyVerbruggen#2 will be skipped:

#	Get refreshToken on iOS sign in
#
#	The refresh token is a useful token for third party apps, to refresh the access token and keep users logged in.

# The commit message EddyVerbruggen#3 will be skipped:

#	Update README.md

# The commit message EddyVerbruggen#4 will be skipped:

#	Updated Google Sign-In iOS SDK to 2.4.0

# The commit message EddyVerbruggen#5 will be skipped:

#	Enabled GoogleOpenSource.framework explicitely

# The commit message EddyVerbruggen#6 will be skipped:

#	EddyVerbruggen#153 Ios updated google framework

# The commit message EddyVerbruggen#2 will be skipped:

#	EddyVerbruggen#168 IOS Build failure with this plugin

# The commit message EddyVerbruggen#2 will be skipped:

#	Added a few npm keywords

# The commit message EddyVerbruggen#3 will be skipped:

#	Update GooglePlus.java
#
#	Fix for app crash on android 6

# The commit message EddyVerbruggen#2 will be skipped:

#	A note about failing Android builds

# The commit message EddyVerbruggen#3 will be skipped:

#	Adding a link to how to use keytool

# The commit message EddyVerbruggen#2 will be skipped:

#	Update README.md

# The commit message EddyVerbruggen#3 will be skipped:

#	Update README.md

# The commit message EddyVerbruggen#4 will be skipped:

#	Google success login redirects to google.com issue fixed

# The commit message EddyVerbruggen#5 will be skipped:

#	iOS readme updated to include latest Google SDK changes

# The commit message EddyVerbruggen#6 will be skipped:

#	Update README.md

# The commit message EddyVerbruggen#7 will be skipped:

#	Update README.md

# The commit message EddyVerbruggen#2 will be skipped:

#	Remove OpenSource and Plus libraries.

# The commit message EddyVerbruggen#2 will be skipped:

#	ignoring some more files

# The commit message EddyVerbruggen#2 will be skipped:

#	Google SignIn framework bump

# The commit message EddyVerbruggen#2 will be skipped:

#	ignore

# The commit message EddyVerbruggen#2 will be skipped:

#	testing sth

# The commit message EddyVerbruggen#3 will be skipped:

#	testing sth

# The commit message EddyVerbruggen#2 will be skipped:

#	new demos for firebase and ionic2+firebase

# The commit message EddyVerbruggen#3 will be skipped:

#	typo fix
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants