Skip to content

Instantly share code, notes, and snippets.

@explon
explon / sso.php
Last active September 24, 2015 00:22
SSO 服务端例子
<?php
if ($_GET['token'])
{
// 解密认证过程省略..
// 认证成功
if ($sso_valid)
{
$output = array(
@explon
explon / sso.html
Created September 23, 2015 06:45
SSO 前端例子
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SSO Demo</title>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
<?php
public function qq_login_callback_action()
{
if (! $_GET['code'])
{
H::redirect_msg(AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录'), "/account/login/");
}
if (! AWS_APP::session()->QQConnect['access_token'])