CapacitorGoogleAuth icon indicating copy to clipboard operation
CapacitorGoogleAuth copied to clipboard

Confirm your choices prompt on every GoogleAuth.signIn()

Open BetterAutomations opened this issue 4 years ago • 2 comments

When I GoogleAuth.signIn() then reboot or force close the app, it closes the connection, and so I signIn() again but get the "Confirm your choices" dialog every time. I don't see this behavior with other apps. I think it has something to do with my OAuth scopes but I've played with the settings, no good. Help?

Using: @codetrix-studio/[email protected] @ionic/[email protected] @ionic/[email protected] @angular/[email protected] [email protected] @capacitor/[email protected] Pixel 3 XL with Android 10 Galaxy S6 with Android 7

capacitor.config.json:

"plugins": {
    "GoogleAuth": {
      "scopes": ["email"],

OAuth non-sensitive scopes: .../auth/userinfo.email

OAuth consent Publishing status: Testing

Screenshot: https://i.imgur.com/FTAyUab.jpeg

async googleSignIn() {
	const googleUser = await GoogleAuth.signIn();
	const idToken = googleUser.authentication.idToken;
	const credential = firebase.auth.GoogleAuthProvider.credential(idToken);
	return this.auth.signInWithCredential(credential);
}

signIn() {
	this.signedIn().then((result) => {
		if (result === true) {
			return true;
		}
		this.googleSignIn().then((googleUser) => {
			if (!googleUser) {
				return;
			}
			this.uid = googleUser['user']['uid'];
		});
	});
}

async signedIn() {
	if (typeof this.uid !== 'string') {
		return false;
	}
	if (this.uid === '') {
		return false;
	}
	return true;
}

Logcat:

2021-06-23 19:34:08.606 7183-7183/com.securecoop.app I/WebViewFactory: Loading com.android.chrome version 91.0.4472.101 (code 447210123)
2021-06-23 19:34:08.667 7183-7183/com.securecoop.app W/ResourceType: Invalid package identifier when getting bag for resource number 0x00000000
2021-06-23 19:34:08.667 7183-7183/com.securecoop.app W/ResourceType: Invalid package identifier when getting bag for resource number 0x00000000
2021-06-23 19:34:08.674 7183-7183/com.securecoop.app I/cr_LibraryLoader: Loaded native library version number "91.0.4472.101"
2021-06-23 19:34:08.675 7183-7183/com.securecoop.app I/cr_CachingUmaRecorder: Flushed 6 samples from 6 histograms.
2021-06-23 19:34:08.686 7183-7183/com.securecoop.app W/ResourceType: Failure getting entry for 0x7f13076e (t=18 e=1902) (error -2147483647)
2021-06-23 19:34:08.724 7183-7208/com.securecoop.app W/chromium: [WARNING:dns_config_service_android.cc(153)] Failed to read DnsConfig.
2021-06-23 19:34:08.772 7183-7183/com.securecoop.app D/Capacitor: Starting BridgeActivity
2021-06-23 19:34:08.782 7183-7183/com.securecoop.app D/Capacitor: Registering plugin: WebView
2021-06-23 19:34:08.786 7183-7183/com.securecoop.app D/Capacitor: Registering plugin: GoogleAuth
2021-06-23 19:34:08.802 7183-7183/com.securecoop.app E/Capacitor: Unable to read file at path public/plugins
2021-06-23 19:34:08.803 7183-7183/com.securecoop.app D/Capacitor: Loading app at http://localhost
2021-06-23 19:34:08.824 7183-7215/com.securecoop.app W/cr_media: Requires BLUETOOTH permission
2021-06-23 19:34:08.848 7183-7228/com.securecoop.app D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so
2021-06-23 19:34:08.855 7183-7183/com.securecoop.app D/Capacitor: App started
2021-06-23 19:34:08.858 7183-7183/com.securecoop.app D/Capacitor: App resumed
2021-06-23 19:34:08.867 7183-7228/com.securecoop.app E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
2021-06-23 19:34:08.868 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: ThreadedRenderer.create() translucent=false
2021-06-23 19:34:08.870 7183-7183/com.securecoop.app D/InputTransport: Input channel constructed: fd=138
2021-06-23 19:34:08.871 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: setView = DecorView@2927bb1[MainActivity] touchMode=true
2021-06-23 19:34:08.885 7183-7212/com.securecoop.app D/Capacitor: Handling local request: http://localhost/
2021-06-23 19:34:08.889 7183-7228/com.securecoop.app E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
2021-06-23 19:34:08.901 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: dispatchAttachedToWindow
2021-06-23 19:34:08.910 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,0][1440,2560] result=0x7 surface={isValid=true 514343215104} surfaceGenerationChanged=true
2021-06-23 19:34:08.910 7183-7236/com.securecoop.app I/OpenGLRenderer: Initialized EGL, version 1.4
2021-06-23 19:34:08.910 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: mHardwareRenderer.initialize() mSurface={isValid=true 514343215104} hwInitialized=true
2021-06-23 19:34:08.910 7183-7236/com.securecoop.app D/OpenGLRenderer: Swap behavior 1
2021-06-23 19:34:08.919 7183-7236/com.securecoop.app D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000,  [1440x2560]-format:1
2021-06-23 19:34:08.977 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
2021-06-23 19:34:08.977 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1
2021-06-23 19:34:08.977 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true 514343215104}
2021-06-23 19:34:08.978 7183-7183/com.securecoop.app V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@105a70f nm : com.securecoop.app ic=null
2021-06-23 19:34:08.978 7183-7183/com.securecoop.app I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
2021-06-23 19:34:08.979 7183-7214/com.securecoop.app D/Capacitor: Handling local request: http://localhost/styles.css
2021-06-23 19:34:08.983 7183-7197/com.securecoop.app D/InputTransport: Input channel constructed: fd=160
2021-06-23 19:34:08.993 7183-7183/com.securecoop.app V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@1ffa52b nm : com.securecoop.app ic=null
2021-06-23 19:34:09.001 7183-7208/com.securecoop.app D/Capacitor: Handling local request: http://localhost/runtime.js
2021-06-23 19:34:09.006 7183-7214/com.securecoop.app D/Capacitor: Handling local request: http://localhost/polyfills.js
2021-06-23 19:34:09.025 7183-7208/com.securecoop.app D/Capacitor: Handling local request: http://localhost/vendor.js
2021-06-23 19:34:09.027 7183-7208/com.securecoop.app D/Capacitor: Handling local request: http://localhost/main.js
2021-06-23 19:34:09.426 7183-7207/com.securecoop.app D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-06-23 19:34:10.037 7183-7183/com.securecoop.app I/Capacitor/Console: File: http://localhost/vendor.js - Line 65340 - Msg: Angular is running in development mode. Call enableProdMode() to enable production mode.
2021-06-23 19:34:10.043 7183-7207/com.securecoop.app D/Capacitor: Handling local request: http://localhost/common.js
2021-06-23 19:34:10.046 7183-7207/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-app_8_entry_js.js
2021-06-23 19:34:10.056 7183-7213/com.securecoop.app D/Capacitor: Handling local request: http://localhost/src_app_tabs_tabs_module_ts.js
2021-06-23 19:34:10.115 7183-7213/com.securecoop.app D/Capacitor: Handling local request: http://localhost/src_app_tab1_tab1_module_ts.js
2021-06-23 19:34:10.128 7183-7214/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_swipe-back-ee838cf8_js.js
2021-06-23 19:34:10.281 7183-7207/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_firebase_auth_dist_index_esm_js.js
2021-06-23 19:34:10.316 7183-7212/com.securecoop.app D/Capacitor: Handling local request: http://localhost/src_app_tab2_tab2_module_ts.js
2021-06-23 19:34:10.319 7183-7213/com.securecoop.app D/Capacitor: Handling local request: http://localhost/src_app_tab3_tab3_module_ts.js
2021-06-23 19:34:10.324 7183-7213/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-tab-bar_2_entry_js.js
2021-06-23 19:34:10.326 7183-7213/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-button_2_entry_js.js
2021-06-23 19:34:10.327 7183-7213/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-item_8_entry_js.js
2021-06-23 19:34:10.340 7183-7256/com.securecoop.app V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 122043054, pluginId: GoogleAuth, methodName: signIn
2021-06-23 19:34:10.340 7183-7256/com.securecoop.app V/Capacitor: callback: 122043054, pluginId: GoogleAuth, methodName: signIn, methodData: {}
2021-06-23 19:34:10.343 7183-7224/com.securecoop.app D/Capacitor: Starting activity for result
2021-06-23 19:34:10.354 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0
2021-06-23 19:34:10.359 7183-7183/com.securecoop.app D/Capacitor: App paused
2021-06-23 19:34:10.400 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: ThreadedRenderer.create() translucent=true
2021-06-23 19:34:10.403 7183-7183/com.securecoop.app D/InputTransport: Input channel constructed: fd=189
2021-06-23 19:34:10.403 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: setView = DecorView@43afde[SignInHubActivity] touchMode=true
2021-06-23 19:34:10.407 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: dispatchAttachedToWindow
2021-06-23 19:34:10.425 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,0][1440,2560] result=0x27 surface={isValid=true 514343218688} surfaceGenerationChanged=true
2021-06-23 19:34:10.425 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: mHardwareRenderer.initialize() mSurface={isValid=true 514343218688} hwInitialized=true
2021-06-23 19:34:10.436 7183-7236/com.securecoop.app D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000,  [1440x2560]-format:1
2021-06-23 19:34:10.509 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
2021-06-23 19:34:10.519 7183-7212/com.securecoop.app D/Capacitor: Handling local request: http://localhost/svg/triangle.svg
2021-06-23 19:34:10.524 7183-7207/com.securecoop.app D/Capacitor: Handling local request: http://localhost/svg/ellipse.svg
2021-06-23 19:34:10.535 7183-7207/com.securecoop.app D/Capacitor: Handling local request: http://localhost/svg/square.svg
2021-06-23 19:34:10.560 7183-7183/com.securecoop.app D/InputTransport: Input channel destroyed: fd=160
2021-06-23 19:34:10.571 7183-7207/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-ripple-effect_entry_js.js
2021-06-23 19:34:10.702 7183-7207/com.securecoop.app D/Capacitor: Handling local request: http://localhost/assets/icon/favicon.png
2021-06-23 19:34:10.709 7183-7214/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_tap-click-cc1ae2b2_js.js
2021-06-23 19:34:10.716 7183-7208/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_status-tap-bdecfebf_js.js
2021-06-23 19:34:10.723 7183-7212/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_keyboard-5742b5da_js.js
2021-06-23 19:34:10.725 7183-7207/com.securecoop.app D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_focus-visible-f4ad4f1a_js.js
2021-06-23 19:34:19.332 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: MSG_WINDOW_FOCUS_CHANGED 1
2021-06-23 19:34:19.333 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true 514343218688}
2021-06-23 19:34:19.333 7183-7183/com.securecoop.app V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@fbe94b5 nm : com.securecoop.app ic=null
2021-06-23 19:34:19.333 7183-7183/com.securecoop.app I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
2021-06-23 19:34:19.335 7183-7183/com.securecoop.app D/InputTransport: Input channel constructed: fd=158
2021-06-23 19:34:19.346 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: Relayout returned: oldFrame=[0,0][1440,2560] newFrame=[0,0][1440,2560] result=0x3 surface={isValid=true 514343218688} surfaceGenerationChanged=false
2021-06-23 19:34:19.385 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1
2021-06-23 19:34:19.385 7183-7183/com.securecoop.app D/ViewRootImpl@8b6ee58[MainActivity]: mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true 514343215104}
2021-06-23 19:34:19.386 7183-7183/com.securecoop.app V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@a5937d8 nm : com.securecoop.app ic=null
2021-06-23 19:34:19.386 7183-7183/com.securecoop.app I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
2021-06-23 19:34:19.388 7183-7183/com.securecoop.app D/InputTransport: Input channel constructed: fd=160
2021-06-23 19:34:19.388 7183-7183/com.securecoop.app D/InputTransport: Input channel destroyed: fd=158
2021-06-23 19:34:19.388 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: MSG_WINDOW_FOCUS_CHANGED 0
2021-06-23 19:34:19.391 7183-7183/com.securecoop.app D/Capacitor: App resumed
2021-06-23 19:34:19.419 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: mHardwareRenderer.destroy()#1
2021-06-23 19:34:19.427 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: Relayout returned: oldFrame=[0,0][1440,2560] newFrame=[0,0][1440,2560] result=0x5 surface={isValid=false 0} surfaceGenerationChanged=true
2021-06-23 19:34:19.441 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: mHardwareRenderer.destroy()#4
2021-06-23 19:34:19.441 7183-7183/com.securecoop.app D/ViewRootImpl@50ad319[SignInHubActivity]: dispatchDetachedFromWindow
2021-06-23 19:34:19.448 7183-7183/com.securecoop.app D/InputTransport: Input channel destroyed: fd=189

BetterAutomations avatar Jun 23 '21 23:06 BetterAutomations

That's the behavior when forceCodeForRefreshToken is set to true.

halversonmd avatar Sep 14 '21 18:09 halversonmd

thats definitely a bug - related to #271. Shame that such a useful plugin is not in better shape...

ciekawy avatar Oct 18 '23 09:10 ciekawy