namespace mvcCookieAuthSample.ViewModels
{
public class ScopeViewModel
{
public string Name { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public string Emphasize { get; set; }
public string Required { get; set; }
public bool Checked { get; set; }
}
}
namespace mvcCookieAuthSample.ViewModels
{
public class ConsentViewModel
{
public string ClientId { get; set; }
public string ClientName { get; set; }
public string ClientLogoUrl { get; set; }
/// <summary>
/// 是否允许第二次登录不需要再次授权
/// </summary>
public bool AllowRemeberConsent { get; set; }
// 对两种用户分别做出选择
public IEnumerable<ScopeViewModel> IdentityScopes { get; set; }
public IEnumerable<ScopeViewModel> ResourceScopes { get; set; }
}
}
@using mvcCookieAuthSample.ViewModels;
@model ScopeViewModel
<li>
</li>
@using mvcCookieAuthSample.ViewModels;
@model ConsentViewModel
<p>Consent Page</p>
<div class="row page-header">
<div class="col-sm-10">
@if (string.IsNullOrWhiteSpace(Model.ClientLogoUrl))
{
<div><img src="@Model.ClientLogoUrl"/></div>
}
<h1>
@Model.ClientName
<small>希望使用您的账户</small>
</h1>
</div>
</div>
<div class="row">
<div class="col-sm-8">
<form asp-action="Index">
@if (Model.IdentityScopes.Any())
{
<ul class="list-group">
@foreach (var scope in Model.IdentityScopes)
{
@Html.Partial("_ScopeListitem", scope)
}
</ul>
}
@if (Model.ResourceScopes.Any())
{
<ul class="list-group">
@foreach (var scope in Model.IdentityScopes)
{
@Html.Partial("_ScopeListitem", scope)
}
</ul>
}
</form>
</div>
</div>