Facebook Mikrotic社交登录

Facebook Mikrotic社交登录,facebook,facebook-login,social,mikrotik,hotspot,Facebook,Facebook Login,Social,Mikrotik,Hotspot,我正在尝试在Microtik HAP RB951Ui-2nD上创建热点门户。我可以添加用户和删除用户,效果很好,但问题是我想将其与facebook身份验证一起使用基本上,一切都应该正常工作,在我的本地主机中使用apache似乎工作得很好,但当我在mikrotik中实际使用它时,我的登录应该具有的facebook功能却不存在 <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible"

我正在尝试在Microtik HAP RB951Ui-2nD上创建热点门户。我可以添加用户和删除用户,效果很好,但问题是我想将其与facebook身份验证一起使用基本上,一切都应该正常工作,在我的本地主机中使用apache似乎工作得很好,但当我在mikrotik中实际使用它时,我的登录应该具有的facebook功能却不存在

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>WIFI-KECE</title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
    $(if chap-id)
        <form name="sendin" action="$(link-login-only)" method="post">
            <input type="hidden" name="username" />
            <input type="hidden" name="password" />
            <input type="hidden" name="dst" value="$(link-orig)" />
            <input type="hidden" name="popup" value="true" />
        </form>

        <script type="text/javascript" src="/md5.js"></script>
        <script type="text/javascript">
        <!--
            function doLogin() {
            document.sendin.username.value = document.login.username.value;
            document.sendin.password.value = hexMD5('$(chap-id)' + document.login.password.value + '$(chap-challenge)');
            document.sendin.submit();
            return false;
            }
        //-->
        </script>
    $(endif)

    <div class="container">
        <div class="col-md-offset-4 col-md-4">
            <div class="login-box">
                <header>
                    <h1>Welcome</h2>
                    <small>Login now! </small>
                </header>

                $(if error) <p style="color:#ff0000;text-align:center;"><small>$(error)</small> $(endif)

                <form class="login" name="login" action="$(link-login-only)" method="post"
                    $(if chap-id) onSubmit="return doLogin()" $(endif)>
                    <input type="hidden" name="dst" value="$(link-orig)" />
                    <input type="hidden" name="popup" value="true" />
                    <div class="form-group">
                        <input class="form-control" name="username" type="text" value="$(username)" placeholder="Username" required/>
                    </div>
                    <div class="form-group">
                        <input class="form-control" name="password" type="password" placeholder="Password" />
                    </div>
                    <button type="submit" class="btn btn-default btn-block">LOGIN</button>

                    $(if trial == 'yes')

                    <div class="second-login text-center">Or you can log in a way like our facebook page.</div>
                    <div style="margin: 0 auto; width: 150px;">
                        <div class="fb-like" data-href="https://www.facebook.com/zeroumit" data-layout="button_count" data-action="like" data-size="large" data-show-faces="false" data-share="true"></div>
                        <div id="fb-root"></div>
                    </div>
                    <script>
                        window.fbAsyncInit = function() {
                            FB.init({ appId: '1271642732875588',
                            status: true,
                            cookie: true,
                            xfbml: true,
                            oauth: true,
                            version: 'v2.5'});

                            FB.Event.subscribe('edge.create',
                                function(response) {
                                    window.location = "$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)";
                                }
                            );
                            FB.Event.subscribe('edge.remove',
                                function(response) {
                                    window.location = "$(link-logout)";
                                }
                            );  
                        };
                        (function() {
                        var e = document.createElement('script'); e.async = true;
                        e.src = document.location.protocol +
                        '//connect.facebook.net/en_US/all.js';
                        document.getElementById('fb-root').appendChild(e);
                        }()); 
                    </script>

                    $(endif)    

                </form>                     
            </div>
        </div>
    </div>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript">
    <!--
      document.login.username.focus();
    //-->
    </script>
</body>

WIFI-KECE
$(如果是chap id)
$(endif)
欢迎
现在登录!
$(如果错误)

$(错误)$(endif) 登录 $(如果试用='是') 或者你可以像我们的facebook页面那样登录。 window.fbAsyninit=函数(){ FB.init({appId:'1271642732875588', 状态:正确, 曲奇:是的, xfbml:是的, 真的, 版本:'v2.5'}); FB.Event.subscribe('edge.create', 功能(响应){ window.location=“$(仅链接登录)?dst=$(链接源esc)和username=T-$(mac esc)”; } ); FB.Event.subscribe('edge.remove', 功能(响应){ window.location=“$(链接注销)”; } ); }; (功能(){ var e=document.createElement('script');e.async=true; e、 src=document.location.protocol+ “//connect.facebook.net/en_US/all.js”; document.getElementById('fb-root').appendChild(e); }()); $(endif)

这是我的login.html
基本上,like按钮、共享等不存在。

您必须允许FB域进入围墙花园

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>WIFI-KECE</title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
    $(if chap-id)
        <form name="sendin" action="$(link-login-only)" method="post">
            <input type="hidden" name="username" />
            <input type="hidden" name="password" />
            <input type="hidden" name="dst" value="$(link-orig)" />
            <input type="hidden" name="popup" value="true" />
        </form>

        <script type="text/javascript" src="/md5.js"></script>
        <script type="text/javascript">
        <!--
            function doLogin() {
            document.sendin.username.value = document.login.username.value;
            document.sendin.password.value = hexMD5('$(chap-id)' + document.login.password.value + '$(chap-challenge)');
            document.sendin.submit();
            return false;
            }
        //-->
        </script>
    $(endif)

    <div class="container">
        <div class="col-md-offset-4 col-md-4">
            <div class="login-box">
                <header>
                    <h1>Welcome</h2>
                    <small>Login now! </small>
                </header>

                $(if error) <p style="color:#ff0000;text-align:center;"><small>$(error)</small> $(endif)

                <form class="login" name="login" action="$(link-login-only)" method="post"
                    $(if chap-id) onSubmit="return doLogin()" $(endif)>
                    <input type="hidden" name="dst" value="$(link-orig)" />
                    <input type="hidden" name="popup" value="true" />
                    <div class="form-group">
                        <input class="form-control" name="username" type="text" value="$(username)" placeholder="Username" required/>
                    </div>
                    <div class="form-group">
                        <input class="form-control" name="password" type="password" placeholder="Password" />
                    </div>
                    <button type="submit" class="btn btn-default btn-block">LOGIN</button>

                    $(if trial == 'yes')

                    <div class="second-login text-center">Or you can log in a way like our facebook page.</div>
                    <div style="margin: 0 auto; width: 150px;">
                        <div class="fb-like" data-href="https://www.facebook.com/zeroumit" data-layout="button_count" data-action="like" data-size="large" data-show-faces="false" data-share="true"></div>
                        <div id="fb-root"></div>
                    </div>
                    <script>
                        window.fbAsyncInit = function() {
                            FB.init({ appId: '1271642732875588',
                            status: true,
                            cookie: true,
                            xfbml: true,
                            oauth: true,
                            version: 'v2.5'});

                            FB.Event.subscribe('edge.create',
                                function(response) {
                                    window.location = "$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)";
                                }
                            );
                            FB.Event.subscribe('edge.remove',
                                function(response) {
                                    window.location = "$(link-logout)";
                                }
                            );  
                        };
                        (function() {
                        var e = document.createElement('script'); e.async = true;
                        e.src = document.location.protocol +
                        '//connect.facebook.net/en_US/all.js';
                        document.getElementById('fb-root').appendChild(e);
                        }()); 
                    </script>

                    $(endif)    

                </form>                     
            </div>
        </div>
    </div>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript">
    <!--
      document.login.username.focus();
    //-->
    </script>
</body>
/ip hotspot walled-garden
add dst-host=*facebook* action=allow
add dst-host=*fbcdn* action=allow
add dst-host=*fb* action=allow
add dst-host=*akamai* action=allow

您可以在www.cloud-hotspot.com上尝试mikrotik的云半径计费和社交登录

mikrotik thingie是否使用HTTP服务您的页面?如果没有,您需要调整SDK加载的地址(因为它现在使用的是协议相对URL)。是的,它使用的是HTTPS协议。我部分遵循了此配置,只是一个愚蠢的问题,我将在每个**中替换什么?好吧,根据您的位置,您必须添加FB的其他域,然而,这是允许FB进入你的热点的常见方法。我已经在围墙花园中插入了几个FB域。问题依然存在。我认为“akamai”域现在是必要的。就我所见,facebook API似乎无法工作,因为文件位于mikrotik路由器中,而不是在线。