Create a gist now

Instantly share code, notes, and snippets.

@explon /sso.php
Last active Sep 24, 2015

What would you like to do?
SSO 服务端例子
<?php
if ($_GET['token'])
{
// 解密认证过程省略..
// 认证成功
if ($sso_valid)
{
$output = array(
'state' => 'success'
);
// 设置 Cookie
setcookie('user_login', '......');
}
else
{
$output = array(
'state' => 'error'
);
}
echo $_GET['jsoncallback'] . '(' . json_encode($output) . ')';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment