Keep OAuth 2.0 Pop open to see error message - google-chrome

I am using a low code platform where I need to authenticate via OAUth 2.0. For this a Popup opens, but the OAuth 2.0 flow fails.
However, I cannot see any error message, because the pop closes so quickly.
How can I keep the Popup open or at least track the content of it?
Here is a gif of what happens:
Best would be to open the DevTools of the Popup somehow, but do this before the Popup closes is impossible...
Any smart ideas?

Related

Progressive Web App (PWA) in standalone mode OAuth error

After I saved my PWA (Test App) built using Create React App to homescreen and launched the app in standalone mode on android using chrome and iOS using safari. Then in the app I initiate Firebase method signInWithPopup(GoogleProvider) the device asks me if I want to open the action with Test App or other browsers installed on device i.e chrome, firefox. If I select to open with my Test App the popup opens and I select the correct Google account.
Error: After the google account selection the popup closes without ever redirecting back to my Test App.
If I instead to open the Firebase method signInWithPopup(GoogleProvider) with chrome browser and not my Test App the popup opens for google account selection and after I select the google account the popup closes and redirects back to the Test App momentarily and then
Error: directs back to chrome tab where is asks for google account to select while showing a loading indicator, and just hangs there.
There are no console error or warnings that come up .
Note 1: The error of popup not closing and staying in loading also occurs if I add the App to homescreen on a Windows 10 x64 machine using Version 64.0.3259.0 (Official Build) canary (64-bit) and launch as a standalone window.
Note 2: The error also occurs for signInWithPopup(Facebookprovider) and signInWithPopup(Twitterprovider) Also If I uninstall app from Homescreen and launch purely in browser the signing in OAuth flow works fine.
Note 3: After further troubleshooting it seems the error more specifically occurs when user input is required in the OAuth popup.
i.e If for example if user has previously given the Test App permissions through Facebook, the flow works fine and the popup closes. Also if only a single google account is detected and it has previously given app OAuth permissions then the popup works as it should. But If multiple google accounts exists on device then the user has to input a selection of which account to sign in through --> this leads to the previously mentioned error again. And using Twitter OAuth the error occurs every-time because twitter popup requires user to select Authorize App every-time.
UPDATE: I believe this may have something to do with google chrome recent changes to OAuth from Webview.
GIf of the error on windows machine: notice the popup for twitter auth never closes, even after authorizing the app, same thing occurs for google and facebook OAuth.
Reading Google documentation:
https://firebase.google.com/docs/auth/web/google-signin
Authenticate with Firebase using the Google provider object. You can prompt your users to sign in with their Google Accounts either by opening a pop-up window or by redirecting to the sign-in page. The redirect method is preferred on mobile devices.
So you have 2 options:
firebase.auth().signInWithPopup(provider)
firebase.auth().signInWithRedirect(provider)
The second must be used when you are into a mobile device.
So the question is: How I detect when I running into a mobile device ?
Code must be something like:
if ( isInMobileDevice) {
firebase.auth().getRedirectResult().then(function(result) { .... }
}
else {
firebase.auth().signInWithPopup(provider).then(function(result) { .... }
}
Sorry, Im still searching the way to get the correct value (true/false) into "isInMobileDevice"
you can stablish in the manifest of the app "display:standalone" then detect the launch mode like this
function isRunningStandalone() {
return (window.matchMedia('(display-mode: standalone)').matches);
}
...
if (isRunningStandalone()) {
/* This code will be executed if app is running standalone */
}
Good news, fixed in Chrome Canary
https://bugs.chromium.org/p/chromium/issues/detail?id=771418#c84

Get Firebase Web Notification Even Close Chrome

I am currently working on a video web application. We rely on notification to notify provider there is call in.
Firebase works well even when I close the tab. I found that if there is any chrome's thread running in background, I will get notification.
Is there any way that I can make a background thread active even the user click close button on chrome? how about chrome extension? does it approach the goal?
Firebase Cloud Messaging for web relies on a service worker to receive messages when the web app is not active/visible. This requires that Chrome is active.
If the user completely quits Chrome, all tabs, service workers and extensions are stopped. There is no way to still receive web push notifications in that case.

WebSocket connections deselecting in Chrome DevTools Network Viewer

I'm trying to use the Chrome DevTools Network viewer to inspect WebSocket frames. I'm not sure if i've discovered a bug or something i'm doing wrong. Essentially, while inspecting the frames, whenever a new frame is recevied, the Network viewer jumps away/deselects the websocket connection. It is particularly bad when there are "ping" type messages being sent every 5-10 seconds, as this makes it almost impossible to keep the frames tab open.
My Chrome version is 58.0.3029.110 (64-bit)
Steps to reproduce:
Hit F12 to open DevTools
Navigate to http://www.websocket.org/echo.html
Check "Use secure WebSocket (TLS)" and click Connect
In DevTools, goto the Network tab and find the websocket connection for the chat (wss://echo.websocket.org/?encoding=text), select it and view the Frames.
Click Send on the page to send a message.
The "?encoding=text" websocket item in the network list will deselect itself and the frames view is gone!.
Any ideas?
I have found a workaround which you can make use of till this bug gets fixed.
Apply search filter to get the required websocket request alone as the displayed item, now the selected blue bg will get hidden but frames tab will not get closed.
Useful filters:
is:running will show currently active websocket request.
domain:requireddomain.com will filter required domain
Looks like this is a bug, as others have reported the same issue here.

Windows .net Google.Apis hangs on the call to InsertMediaUpload.Upload -- there is no timeout

I am using GoogleApis to upload documents to Google Drive using the InsertMediaUpload class from the FilesResource namespace and the Upload method. It is working well for me with the following exception:
After calling InsertMediaUpload, a browser window appears asking the user to log into their Google (usually Gmail) account. If the user simply closes the browser window instead of clicking on "Accept" or "Cancel" then the current process appears to be hung. I suppose there should a timeout of a minute or two so that if the user opts to not log in the current windows application will not simply hang and stop working indefinitely.
There is no need for sample code here. What should happen when the user simply closes the browser window instead of clicking cancel if they are no longer interested in uploading a document? Crashing (or hanging) the current process should not be a possibility, but that is what occurs. One would hope closing the browser window would have the same effect as clicking the cancel button -- just another way of opting out of an upload to Google Drive, right?
Thanks in advance for any help with this.
You're not supposed to get authentication message from InsertMediaUpload class. You should handle authentication by yourself. Authentication browser window you get is for your development convenience, not for production code. Please take a look at .net quickstart. In this quickstart, you'll see GetAuthorization method which handles authentication. Modify this method on your needs and you'll get what you want.

Unable to redirect to particular page when click on toast notification in windows phone 8 app

I am developing a chat application...
For getting toast notifications i am sending notification uri to Microsoft server...
When i close app if i am getting toast notifications,i click on toast then it is redirecting to particular page that i specified..
But when i deactivating from the app and if i got any toast notification and i click on it then it is not redirecting to that chat page but redirecting to the page that i deactivating from the app.
I hope you understand the scenario..
How to redirect to that page when i deactivated the app also?
Since you're using Fast App Resume you'll want to read through http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj735579(v=vs.105).aspx and even play with the sample code right at the end of that article.
You should be getting a Navigated event which you can handle to refresh your content / redirect to the right place. If it isn't working for you and you aren't cancelling any in-progress navigations during app resume then there may be an edge case bug that you're hitting.