facebook登陆

<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/zh_CN/sdk.js#xfbml=1&appId={your appId}&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<script>

//facebook
var sendFbid1 = function() {
              FB.getLoginStatus(function(response){
                    if(response.status == 'connected') {
                                
                        var id = "";
                        var name = "";
                           FB.api('/me', function (response) {

id = response.id;
                            name = response.name;
                            email = response.email;
                            gender = response.gender;
                            
                            
                            var api_url  = 'user.php?act=api_login';
                            $.post(api_url, { id: id, name: name, email: email, gender: gender, type: 'facebook' },
                                function(data){
                                    if(data == 1)
                                    {
                                        window.location.href="index.php";
                                    }
                            });                            
        
                        });            
                     }
                    else{
                    
                    FB.login(function(){}, {scope: 'publish_actions'});
                       FB.login();
                    }
             });
    };
    window.fbAsyncInit = function() {
        FB.Event.subscribe('auth.login', sendFbid1);
        FB.Event.subscribe('auth.authResponseChange', sendFbid1);
    }    
</script>


google登陆

<script type="text/javascript">

// 加载google js文件
    (function() {

var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/client:plusone.js?οnlοad=render'; // 后边加onload触发初始化函数
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
    // 初始化函数
    function render() {
        gapi.signin.render('google_login', {
            'callback': 'signinCallback',
            'approvalprompt': 'auto',
            // 这里写入你的App ID
            'clientid': ' {your clientid}',
            'cookiepolicy': 'single_host_origin',
            'requestvisibleactions': 'http://schemas.google.com/AddActivity',
            'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email'
        });
    }
    // 回调函数
    function signinCallback(authResult) {
        if (authResult) {
            // 是否有错
            if(authResult["error"]==undefined){
                // 隐藏登录按钮
                $("#google_login").hide();
                // 加载api

gapi.client.load("oauth2","v2",function(){
                    var request=gapi.client.oauth2.userinfo.get();
                    request.execute(function(obj){
                        // 取得登录邮箱并显示                        
                        if(obj["email"]){
                        
                              id = obj["id"];
                            name = obj["name"];
                            email = obj["email"];
                            gender = obj["gender"];
                            
                            var api_url  = 'user.php?act=api_login';
                            $.post(api_url, { id: id, name: name, email: email, gender: gender, type: 'google' },
                                function(data){
                                    if(data == 1)
                                    {
                                        window.location.href="index.php";
                                    }
                            });                                                                                
                        }
                    });
                });

}
        }
    }
         
    // 取消与应用关联的代码
    function disconnectUser() {
            var revokeUrl = 'https://accounts.google.com/o/oauth2/revoke?token=' + gapi.auth.getToken().access_token;
           
            $.ajax({
                type: 'GET',
                url: revokeUrl,
                async: false,
                contentType: "application/json",
                dataType: 'jsonp',
                success: function(nullResponse) {
                    // 成功以后隐藏登录信息
                    // 显示登录按钮
                    $("#google_login").show();
                    alert("退出成功!");
                },
                error: function(e) {
                    alert("!請到 https://plus.google.com/apps 手动解除!");
                    window.open("https://plus.google.com/apps");
                }
            });

}

</script>

qq企业邮箱登陆

public function login_exmail(){

$admin_qq_email = $_SESSION['fruser_accout'] . "@{企业邮箱}.com";
        $this->load->library('curl');

if( empty($_SESSION['access_token']))
        {
            $token_url = "https://exmail.qq.com/cgi-bin/token";
            $post_data = array (
            'grant_type' => 'client_credentials',
            'client_id' => '{your_client_id}',
            'client_secret' => '{your client_secret}',
            );

$token_json = $this->curl->post($token_url,$post_data);
            $token_result = json_decode($token_json);
            $access_token = $token_result->access_token;
            $_SESSION['access_token'] = $access_token;
        }
        else
        {
            $access_token = $_SESSION['access_token'];
        }

if(!empty($access_token) && empty($_SESSION['auth_key']))
        {
            $authkey_url = "http://openapi.exmail.qq.com:12211/openapi/mail/authkey";
            $header_data = array (
                'Host: exmail.qq.com',
                'Authorization: Bearer ' . $access_token
            );

$post_data = array (
                "alias" => $admin_qq_email,
            );
            $authkey_json = $this->curl->post($authkey_url,$post_data, $header_data);
            $authkey_result = json_decode($authkey_json);
            $auth_key = $authkey_result->auth_key;
            $_SESSION['auth_key'] = $auth_key;
        }
        else
        {
            $auth_key = $_SESSION['auth_key'];
        }

if(!empty($auth_key))
        {
            header ( "Location: https://exmail.qq.com/cgi-bin/login?fun=bizopenssologin&method=bizauth&agent={your_client_id}&user="
            . $admin_qq_email . "&ticket=" . $auth_key );
        }

}

facebook google qq企业邮箱 登陆相关推荐

  1. 图文讲解如何在outlook里设置绑定QQ企业邮箱教程

    本文转载自: https://www.cnblogs.com/naniannayue/archive/2010/10/15/1852056.html 作者:naniannayue 转载请注明该声明. ...

  2. 图文讲解如何使用QQ企业邮箱绑定域名开通企业邮箱(使用时代互联的域名管理后台)

    原文地址为: 图文讲解如何使用QQ企业邮箱绑定域名开通企业邮箱(使用时代互联的域名管理后台) 开通免费QQ企业邮箱很简单,只要以下几步: 第一步:注册. https://exmail.qq.com/  ...

  3. jenkins之qq企业邮箱配置

    一.配置qq企业邮箱 1.登录jenkins后台管理,选择 系统管理 ☞  系统设置 2.SMTP server配置 3.邮件通知配置 配置ssl等参数  点击 高级 4.发送邮件测试 总结:邮箱配置 ...

  4. hive解绑邮箱_django使用QQ企业邮箱发送邮件

    一.首先申请QQ企业邮箱 二.配置自己的域名 在域名解析中添加域名解析 添加MX类型的记录: 腾讯企业邮箱要求设置的MX记录如下: 邮件服务器名:mxbiz1.qq.com 优先级:5 邮件服务器名: ...

  5. 微信企业邮箱登陆入口在哪?企业邮箱忘记密码怎么修改?

    微信企业邮箱怎么登陆?那么微信有没有企业邮箱呢?是有的,就是TOM企业邮箱.在职场办公中,很多重要的通知及正式文件都是通过邮件进行下发传达的,因此邮箱在我们的工作中有非常重要的作用. 微信企业邮箱登陆 ...

  6. QQ企业邮箱绑定微信

    入职需要 QQ企业邮箱 绑定登录微信. 具体步骤: 下载企业微信APP ,注册企业微信账号: 企业微信选择:"我->设置->账号->微信"绑定现对应微信: 登录Q ...

  7. phpmailer发送邮件(QQ企业邮箱和163邮箱)

    注意:使用个人qq邮箱发送邮箱会被腾讯拦截发送失败 第一:163邮箱配置 1.登录163邮箱:https://email.163.com/ 2.在邮箱的设置中开启SMTP服务(设置->POP3/ ...

  8. 腾讯企业邮信任此计算机,讲述qq企业邮箱启用微信动态密码的方法

    qq企业邮箱的微信动态密码: "微信动态密码"是腾讯企业邮箱推出的全新功能,启用"微信动态密码"功能后,网页登录邮箱需验证动态密码,动态密码验证通过后方能成功登 ...

  9. php使用最新qq企业邮箱smtp服务发送邮件需要开启ssl、开启客户端专用密码

    几年前开通的qq企业邮箱,可以正常使用smtp发送邮件. 今天重新使用发现不行,研究后发现问题主要出在2个地方:1.qq企业邮箱强制要求ssl方式请求:2.smtp邮箱账号密码为qq企业邮箱的客户端密 ...

最新文章

  1. 闲着无聊去体验远程面试,最后竟然被录取了...
  2. 卷积神经网络中的参数计算
  3. EOS账户系统(5)action分级
  4. 【超100%解法】剑指 Offer 33. 二叉搜索树的后序遍历序列
  5. Linux ReviewBoard安装与配置
  6. 上海计算机和金融专业,姚明:我将去上海交大读书 选择计算机金融专业
  7. 【高校宿舍管理系统】第八章 学生管理和楼宇管理以及寝室管理
  8. JUST——简单转换下的JSON
  9. mybatis报-因为 accessExternalDTD 属性设置的限制导致不允许 http 访问
  10. 信息系统项目管理--论文分析笔记
  11. Unicode program converted
  12. JavaScript打点计时器
  13. Android人脸检测功能和检测特效
  14. Python生信练习——hg38每条染色体基因,转录本的分布
  15. ACK Acknowledgement 确认 AES Advanced Encryption Standard 高级加密标准 ATM Asynchronous Transfer Mode异步传输模式
  16. Codeforces Gym - 101341A Streets of Working Lanterns - 2 [贪心]
  17. SwiftUI基础——创建并组合视图
  18. 【mysql】事务的四大特性
  19. MacBook Air M1硬盘写入量查询
  20. jadx 支持 Windows、Linux、 macOS,能够帮我们打开.apk, .dex, .jar,.zip等格式的文件

热门文章

  1. goldenboy机器人_急求阿西莫夫机器人,基地,帝国三大系列的书名及其简介
  2. 无缝切地图的3D赛车游戏火了,小哥花16个月用JS打造,浏览器免费就能玩
  3. PHP.ini 中文注解
  4. 【硬件】常见芯片封装技术
  5. 打开电脑任务管理器的方法
  6. 游戏skr而止,漏洞周而复始 —— 游戏合约漏洞全面汇总 | 漏洞分析连载之六
  7. [费用流]2018 Multi-University Contest 10 L.Videos
  8. 导航电子地图数据中POI搜索技术原理之二
  9. JavaWeb实训项目:基于SSM框架的CRM客户关系管理系统(文章最后有源码)
  10. Unity导出exe报错,PC端