简体   繁体   中英

Facebook like popup window for custom oAuth

I want to show a popup window like facebook login and on a successful login i want to close that popup window and redirect to original one.

i am using my custom oAuth but i want to use it like a Facebook login

i am using sencha touch and when i open window using window.open a new full screen window opens up and on a successfully login the redirect page is opening in the new popup window only.

在此处输入图片说明

Why don't you use something like a floating container with an iframe

Ext.define('MyApp.view.oAuthContainer', {
    extend: 'Ext.Container',

    config: {
        centered: true,
        height: 300,
        width: 400,
        hideOnMaskTap: false,
        modal: true,
        html: '<iframe src="https://myOAuthLoginService onLoad="MyApp.app.getController("MyController").myMethodToHandleAniFrameRedirect(this);"></iframe>"',
        items: [{
            xtype: 'toolbar',
            docked: 'top',
            items: [{
                xtype: 'spacer'
            }, {
                xtype: 'button',
                handler: function(button, event) {
                    button.up("container").hide({type: 'fade', out: true});
                },
                iconCls: 'delete'
            }]
        }]
    }
});

Then all you would have to do is create a controller called MyController with a method called myMethodToHandleAniFrameRedirect(iframe) to handle the iframe redirect upon successful oauth login. You can grab the url from the iframe object in the method to make sure that authentication was successful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM