routine update

This commit is contained in:
yubaolee
2016-07-19 15:18:45 +08:00
parent 0aa470a8ca
commit aabd344ec9
4 changed files with 12 additions and 7 deletions

View File

@@ -1,20 +1,23 @@
using System.Web.Mvc;
using System.Configuration;
using System.Web.Mvc;
using OpenAuth.App.SSO;
namespace OpenAuth.WebTest.Controllers
{
public class LoginController : Controller
{
private string _appKey = ConfigurationManager.AppSettings["SSOAppKey"];
// GET: Login
public ActionResult Index()
{
ViewBag.AppKey = _appKey;
return View();
}
[HttpPost]
public ActionResult Index(string username, string password)
{
var result = AuthUtil.Login("openauth", username, password);
var result = AuthUtil.Login(_appKey, username, password);
if (result.Success)
return Redirect("/home/index?Token=" + result.Token);
else

View File

@@ -35,7 +35,7 @@
<input type="checkbox"> Remember me
</label>
<button type="submit" class="btn btn-primary">登陆</button>
<a href="http://localhost:52789/SSO/Login?appkey=openauthtest">或者使用OpenAuth.net第三方登陆功能</a>
<a href="http://localhost:52789/SSO/Login?appkey=@ViewBag.AppKey">或者使用OpenAuth.net第三方登陆功能</a>
</div>
</div>
</form>