mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-21 02:57:54 +08:00
v1.2版,全面实现SSO登陆
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
using System.Web.Mvc;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.App.SSO;
|
||||
|
||||
namespace OpenAuth.WebTest.Controllers
|
||||
{
|
||||
public class HomeController :Controller
|
||||
{
|
||||
|
||||
[SSOAuth]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var currentUser = AuthUtil.GetCurrentUser();
|
||||
ViewBag.CurrentUser = currentUser;
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult Admin()
|
||||
{
|
||||
return Redirect("http://localhost:56813?token=" + Request.Cookies["Token"].Value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user