Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
SSO 前端例子
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SSO Demo</title>
<script src=""></script>
<!-- Passport 登录成功后的处理页面 -->
<script type="text/javascript">
var PASSPORT_TOKEN = '[加密后的令牌, 由服务端输出]';
$(document).ready(function () {
$.getJSON('' + PASSPORT_TOKEN + '&jsoncallback=?', function (result) {
if (result.state == 'success')
// SSO 应用登录成功处理
else if (result.state == 'error')
// SSO 应用登录失败处理
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment