Base solution for your next web application
Open Closed

Issue with supporting oAuth gmail login from mobile device #6234


User avatar
0
commondesk created

Hi, we have a couple questions

  1. For Gmail oAuth, we want to support a mobile application which connects to our netzero website, we noticed the website uses a popup to ask for the login credentials, since popups are not possible in the same way on iOS, we want to know if you have support out of the box for iOS and how to enable it, if possible

  2. Current approach To allow our mobile app to login to the website:

  • We have enabled google authentication to authenticate the users.
  • When we use Google authentication using redirect mode. It just returned the same base url with queryparams such as scope , Id_token , login_hint , client_id .
  • PROBLEM: This approach does not get the user created and does not callback the method for authenticate “googleLoginStatusChangeCallback()” from login.service.ts. a. Why the behavior changes when using the “redirect” mode? b. We enabled authentication mode redirect using ux_mode:’redirect’ property inside “gapi.load('client:auth2')”. This works on the mobile app and we get requested the email and password, after that we never get the expected behavior on the web app as we did when login with the popup on a full Chrome web browser c. Reverting to popup, User gets authenticated and account created, however this mode doesn’t work on mobile because of the popup

And also inside login.component.ts , inside ngOnInit() method there is only code for ‘openIdConnect’ for executing the callback method. Its not there for Google. Is this expected, where should we look for the google callback after authentication, if using the “redirect” mode?

Environment Details:

  • We are using Asp.net Zero framework version 6.1 with Angular 6 for our web application
  • The web application runs on a Linux or Windows server
  • On our mobile app we only display the login page and a few other pages from the web app, i'm not sure the app has to run something inside the mobile app to fully be able to connect from mobile->web app and web app->mobile?
  • Our app uses the https://developer.apple.com/documentation/webkit/wkwebview iOS browser, we don’t do any special handling or override
  • We had this working for version 5 with javascript, the same configuration but for the current version is not working on iOS, is there a guide we can use for this?

IMPORTANT NOTE:

We need to support both mobile apps and web browsers, either embedded or standalone

Thanks for your help

Regards


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @commondesk

    we want to support a mobile application which connects to our netzero website

    In your scenario, it seems like Google is the authenticator. So, why don't use authanticate users using mobile app directly from Google (Gmail) ? Putting AspNet Zero between your mobile app and Google is not necessary I guess.

    For Angular app, Google Login only supports popups as far as I remember. It doesn't support implicit login (redirect and get back the information from Google).

  • User Avatar
    0
    commondesk created

    will repost correct reponse soon.

  • User Avatar
    0
    commondesk created

    Hello, thanks for your reply

    We are not using the website only as an authenticator between gmail and out app, we provide access to the netzero website in an embedded browser on our app, the user has to interact with pages on the website from within the ios app

    Also we allow the user to create a new account on the netzero website using oauth from gmail or microsoft, this is working on the previous version of the site with js

    Are you aware of why the redirect or implicit flow scenario is not supported for Angular and Google? it seems to work fine on the previous version

  • User Avatar
    0
    ismcagdas created
    Support Team

    @commondesk

    I think I got you wrong at the first place. Could you create an issue on https://github.com/aspnetzero/aspnet-zero-core/issues and let us check it ?

  • User Avatar
    0
    commondesk created

    Hello, i have created the issue now

    [Google oauth with implicit flow instead of popup #2107](https://github.com/aspnetzero/aspnet-zero-core/issues/2107)

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks :), closing this one.