Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in IOS9 Safari does not work FB and G+ login popups #885

Open
kirill-sokolov opened this issue Jul 21, 2016 · 5 comments
Open

in IOS9 Safari does not work FB and G+ login popups #885

kirill-sokolov opened this issue Jul 21, 2016 · 5 comments

Comments

@kirill-sokolov
Copy link

I have problem with satellizer on mobile devices. Have read all previous threads and didn't find answer on this issue.
No problems with desktop devices
Tested this on iPad with IOs9 safari, and also android 6 / firefox.
Facebook popup opens, I enter my credentials in it, after submit it just closes and nothing happens.
My function:

function authenticate(provider) {
    console.log(provider);
    return $auth.authenticate(provider);
}

I can see console.log dump with "facebook" before auth.
Code that i'm running:

MyService
    .authenticate(provider)
    .then(onAuthSuccess)
    .catch(onAuthError);

onAuthSuccess and onAuthError are called only on desktops, but not on mobile devices ( tested on Ipad IOS9 Safari ),
looks like promise from .authenticate(provider) isn't returned on mobile devices.

@chungconscious
Copy link

+1

having the same issue

it seems to work on mobile Chrome though (iOS + Android)

@chungconscious
Copy link

Hi all -

I haven't resolved the issue but I have found some interesting behavior...

I am not super familiar with satellizer's code base so I am hoping someone could shed some light here to solve this issue for what seems like a lot of people!

In certain mobile browser versions, the main app tab seems to go "dormant" and doesn't see that the satellite oauth popup tab has returned with the ?code param.

I am seeing this on iOS Safari and Android Firefox.
Chrome does not have this issue in either iOS or Android.

  1. user clicks on button to fire authenticate for FB/Google

satellite opens a new tab to auth with FB/Google and automatically navigates to it

  1. user enter login info for FB/Google

satellite fires redirect to my specified redirect page with ?code param

EXPECTED BEHAVIOR:

  • satellite polls the 2nd tab (my redirect page) and then automatically closes it
  • user is brought back to original browser tab and is logged in to my app

ACTUAL BEHAVIOR:

  • the 2nd tab is not automatically closed and stays open indefinitely

BUT, what I notice is that after step 2,

A) if I MANUALLY navigate back to the original browser tab (WITHOUT closing the oauth tab), the original browser tab wakes up, the promise from auth.authenticate() is successfully resolved, and my user gets logged in

B) if I CLOSE the redirect tab (the one that has the ?code parameter), and am brought back to the original browser tab, nothing happens (presumably because it can no longer find the popup with the ?code param value)

For reference, here is my authProvider config for FB & Google. And this seems to occur on both Satellite 0.14 and 0.15.4

$authProvider.facebook({
name: 'facebook',
url: '/auth/facebook',
authorizationEndpoint: 'https://www.facebook.com/v2.5/dialog/oauth',
redirectUri: window.location.origin + '/auth/callback/index.html',
requiredUrlParams: ['display', 'scope'],
scope: ['email'],
scopeDelimiter: ',',
display: 'popup',
oauthType: '2.0',
popupOptions: { width: 580, height: 400 }
});

$authProvider.google({
url: '/auth/google',
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
redirectUri: window.location.origin + '/auth/callback/index.html',
requiredUrlParams: ['scope'],
optionalUrlParams: ['display'],
scope: ['profile', 'email'],
scopePrefix: 'openid',
scopeDelimiter: ' ',
display: 'popup',
oauthType: '2.0',
popupOptions: { width: 452, height: 633 }
});

@chungconscious
Copy link

haha, directly related to #829

@Machecek
Copy link

Machecek commented Feb 9, 2017

@chungconscious Did you found any resolution for this problem?

@chungconscious
Copy link

@Machecek - nope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants