question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support of the new window simulation into iframe for the login via social networks purposes

See original GitHub issue

I’ve figured out that we have simple way to login via social networks. I’ve tried to log in to the site from an issue #1385 via a Facebook account and I’ve got it in two steps:

const patchAuth = ClientFunction(() => {
    window.open = function (url) {
        var iframe = document.createElement('iframe');

        iframe.style.position = 'fixed';
        iframe.style.left = '200px';
        iframe.style.top = '150px';
        iframe.style.width = '400px';
        iframe.style.height = '300px';
        iframe.style['z-index'] = '99999999';;		
        iframe.src = url;
        iframe.id = 'auth-iframe';

        document.body.appendChild(iframe);
    };
});

Final test:

fixture `fixture`
    .page `https://www.soudfa.com/signup`;

test('test', async t => {
    await patchAuth();

    await t
        .click('button.facebook')
        .switchToIframe('#auth-iframe')
        .typeText('#email', 'email***')
        .typeText('#pass', 'pass***')
        .click('#u_0_0')
        .wait(30e3);
});

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:27 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
LavrovArtemcommented, Jun 14, 2018

Hi @joshpitzalis, I need some time to investigate it.

1reaction
viking2917commented, Mar 18, 2018

@LavrovArtem Thanks for this example. I am also trying to use Test Cafe to test my app with Facebook login (I am using Ionic and the Facebook login plugin as well)

When I follow your steps above, I get the following errors:

O {code: "auth/popup-blocked", message: "Unable to establish a connection with the popup. It may have been blocked by the browser."} "email: " undefined "code " "auth/popup-blocked" (from hammerhead.js line 2)

and

Refused to display 'http://192.168.1.82:54306/2Bt1Drjkn!i/https://m.facebook.com/login.php?skip_api_login=1&api_key=518797921496187&signed_next=1&next=https%3A%2F%2Fm.facebook.com%2Fv2.8%2Fdialog%2Foauth%3Fredirect_uri%3D.......' in a frame because it set 'X-Frame-Options' to 'deny'.

I think this is because the url of the frame opening the FB login is ‘http://192.168.1.82:54306/ …’ and my Facebook Login settings do not include that particular URL/port combination in the ‘Valid OAuth redirect URIs’ settings. But because test cafe generates a new port number every time, I don’t see any way to add it…not sure if that’s clear but wondering if you have any suggestions?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Protect Your Website From Its Embedded Content With iFrames
If all you want the iframe to be able to do is present a social network button, there should be a mechanism to...
Read more >
How to Implement OpenID Authentication in iFrame - Medium
Create an iframe where you want to display authentication page and give it a unique name. Just make sure that the iframe is...
Read more >
AAD login page in iframes - nafis.dev
What can and can't you do with the AAD login page in an iframe? Setup. I start by registering an AAD app through...
Read more >
Overnight Mountings Web Solutions: iFrame Links
iFrame Links. 1. Only registered customers can use iFrame Links. 2. Login at http://www.OvernightMountings.com/customer/account/login/. 3. Click on the “Web ...
Read more >
Iframe - OutSystems 11 Documentation
Iframe displays information from other apps on the screen in small previews. - OutSystems 11 Documentation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found