Google oauth2 failed for gapi.auth.authorize in windows phone and desktop IE metro browser - google-oauth

In the app I am using Google+ SignIn using oauth2. To authorize user, I am using gapi.auth.authorize(authParams) with javascript flow.
On g+ button click I am calling
gapi.auth.authorize({client_id:xyz, scope:'profile email', authuser:'', prompt:'select_account'})
NOTE:I am doing authuser:'', so that it will ask which account I want to getIn, instead of taking default account.
In browsers like chrome, safari, desktop IE and in devices like android, iphone it is working fine. But in windows phone and in IE Metro browser, on click its opening google's accountChooser page. On selecting the account, in callback I am getting error as on debug.
Unhandled exception at line 13, column 32 in https://ssl.gstatic.com/accounts/o/3655170095-postmessagerelay.js 0x80070005 - JavaScript runtime error: Access is denied.
Couldn't get what is the issue? And how this can be handled?

Related

Electron Desktop Expo OAuth2 Login

I am building an app using Expo/React-Native for multiple platforms using OAuth2 as AuthProvider.
So far, successfully logging in on android devices, web browsers (Chrome, Edge), iOS devices.
But unfortunately, I have an issue completing logging in on electron/desktop app.
I am directed to OAuth2 server (using promptAsync from Expo Api/AuthSession)
, and successfully logging in, but not being redirected into my desktop app. Once the credentials are successfully entered on the popup dialog, the login popup dialog should redirect back to the app so I can use ‘code’ to get to access_token.
Sample project here.
How do you expo AuthSession.useAuthRequest to complete login from electron?

Preventing users to get 403 disallowed_useragent Google error in react-native app

I've developed a react-native app which uses Auth0 to authenticate users.
I am getting a 403 disallowed_useragent error when some users try to authenticate using Google from my react-native app, using webAuth. As I searched, this is related to the browser app installed in the user device.
I can reproduce this issue using an Android 11 emulator disabling the Chrome browser, so the OS uses the WebView Browser Tester. If I let Chrome browser enabled, everything works OK.
So my question is: Is there a way to check if the browser installed in the user device supports Google Auth? So I can tell the user to update/install his browser if necessary.
I am using the official SDK react-native-auth0 v2.9.0 and react-native v0.66.0

Javascript Facebook sdk - captive portal on mobile devices

We are setting up a web app which serves as a wi-fi hotspot using coova chilli and the Javascript Facebook SDK.
The app has a "login with facebook" button that, once clicked, calls the FB.login() function, which opens a pop-up window where the user can insert his credentials and log in.
This solution is working correctly in desktop browsers but it's not working in mobile devices.
These are the problems I encountered:
Android device - When I connect to the wifi network, the system prompts a notification who says "Sign in to wifi network". Once clicked, the captive page opens up correctly. But when I click the fb login button, I am redirected to the url "http://m.facebook.com/v2.8/auth ..." which is correct, but then the windows freezes and I can see only a wsod.
IOS device - same as before, the cna triggers, the redirect to the fb login page works, but once I insert my credentials, the only thing I can see is a wsod.
Both issues can be bypassed by including apple.com, google.com and other domains used for auth in the hotspot walled garden, and then the user can log in to the network by using the device's browser - Safari or Chrome, it works - as pointed out in this discussion Facebook login on Apple CNA.
The thing is, we want to make it work on the "normal" workflow, that is, to make the app work correctly within the IOS captive network assistant and the Android "sign in to wi fi" functionality.
Do you have any idea how can we solve this? We searched far and wide without any success. Thank you.
EDIT
Solved by using PHP SDK instead of javascript. By generating a login link as explained here. This works also on mobile captive portal assistants such as ios and android ones because the fb login page is opened in the same window and not in popup/iframe. I hope this helps others that may encounter the same problem.

FirebaseSimpleLogin not working in Windows 8 app

I asked a question earlier about if it was possible to use Firebase in a Windows 8/WinJS app. #MichaelLehenbauer told me that I just needed to add the following line to my code in order to fix a bug in firebase.js:
Firebase.INTERNAL.forceWebSockets()
This worked great and allowed me to read and write to my Firebase. However, now I am trying to get auth working in Windows 8 and running into many issues. I am trying to use the Facebook login but when I call auth.login("facebook"), my app loses focus and a new tab in the modern Internet Explorer app (not the desktop app) is opened with the typical Facebook login prompt. If I put in my credentials and hit login, nothing happens. I need to go back to my app but then it fires up a new IE tab and the process starts again. Instead of opening a new IE tab, Firebase should internally be opening an in-app dialog like seen in the top image here.
So, since I couldn't get the Firebase Facebook login working in WinJS, I tried doing the Facebook login myself and then create Firebase users using the email/password auth. However, when I run:
auth.login("password", {
email: "me#example.com",
password: "password"
});
I get the following warning (which is the same warning I received from firebase.js befoore Michael suggested to me to force web sockets):
APPHOST9601: Can’t load <https://auth.firebase.com/auth/firebase?&firebase=[my_firebase]&transport=jsonp&email=me%40example.com&password=password&callback=FirebaseSimpleLogin._callbacks._firebaseXDR13889674277557>. An app can’t load remote web content in the local context.
I'm not sure if this is another web sockets issue or not, but it looks like FirebaseSimpleLogin is just not working very well in Windows 8 apps. Are there any workarounds to these problems? Even better, is there any plan to provide full support out of the box with Windows 8?
Windows 8 is now supported out of the box with Firebase Simple Login.

Mobile Safari FB.login Oauth Redirect Error

I have a mobile web application that integrates with the Facebook Graph API.
Basically, it uses the JS SDK to obtain details about the viewing user that it can then use to render user specific content.
I use the FB.login function to have the user login to my Facebook app. This should work as follows:
JS on pages detects that user has not logged in to Facebook app
User is given button to click to fire FB.login
User is redirected to Facebook page to authorise the app and login
User is redirected back to my mobile web application
JS on pages detects that user is logged in to Facebook app, polls user data from Graph and renders it.
This all works fine on Android, but the redirect step does not work on Mobile Safari
The user gets an error referring to an EntityRef, which looks like the Content-type being sent to the browser is XML but where the content includes an illegal character:
Error on line 1 at column 49: EntityRef: expecting ';'
This is the actual link that is generating the error:
https://m.facebook.com/dialog/oauth?display=touch&domain=cgfoodscomp.herokuapp.com&scope=email&e2e=%7B%7D&app_id=135937919902029&locale=en_US&sdk=joey&client_id=135937919902029&redirect_uri=https%3A%2F%2Fs-static.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D24%23cb%3Df3cf8ca2ac%26origin%3Dhttps%253A%252F%252Fcgfoodscomp.herokuapp.com%252Ff2d1c54b04%26domain%3Dcgfoodscomp.herokuapp.com%26relation%3Dopener%26frame%3Df35f8ac348&origin=2&response_type=token%2Csigned_request
When you open this in another browser, you get a response with Javascript (I won't post it here as it contains script tags), which contains references to the iPhone:
iPhone.*Version/(5|6)
I'm actually using a Version 4 IOS.
Does anyone know if this stuff is supposed to work in Version 4?
This is a Facebook Bug, which is due for resolution:
https://developers.facebook.com/bugs/339889299473431