🔄refactor: 使用OpenIddict 重构Identity

This commit is contained in:
yubaolee
2026-06-25 23:42:43 +08:00
parent 7a34fa7c51
commit 5e6ca18770
42 changed files with 697 additions and 2074 deletions

View File

@@ -1,11 +1,5 @@
@model OpenAuth.IdentityServer.Quickstart.Home.ErrorViewModel
@{
var error = Model?.Error?.Error;
var errorDescription = Model?.Error?.ErrorDescription;
var request_id = Model?.Error?.RequestId;
}
<div class="error-page">
<div class="page-header">
<h1>Error</h1>
@@ -16,25 +10,16 @@
<div class="alert alert-danger">
Sorry, there was an error
@if (error != null)
@if (!string.IsNullOrEmpty(Model?.ErrorId))
{
<strong>
<em>
: @error
</em>
</strong>
<div>Error Id: @Model.ErrorId</div>
}
if (errorDescription != null)
{
<div>@errorDescription</div>
}
@if (!string.IsNullOrEmpty(Model?.ErrorMessage))
{
<div>@Model.ErrorMessage</div>
}
</div>
@if (request_id != null)
{
<div class="request-id">Request Id: @request_id</div>
}
</div>
</div>
</div>

View File

@@ -1,9 +1,8 @@
@using IdentityServer4.Extensions
@{
@{
string name = null;
if (!true.Equals(ViewData["signed-out"]))
{
name = Context.User?.GetDisplayName();
name = Context.User?.Identity?.IsAuthenticated == true ? Context.User.Identity.Name : null;
}
}
<!DOCTYPE html>

View File

@@ -1,34 +0,0 @@
@model OpenAuth.IdentityServer.Quickstart.Consent.ScopeViewModel
<li class="list-group-item">
<label>
<input class="consent-scopecheck"
type="checkbox"
name="ScopesConsented"
id="scopes_@Model.Name"
value="@Model.Name"
checked="@Model.Checked"
disabled="@Model.Required" />
@if (Model.Required)
{
<input type="hidden"
name="ScopesConsented"
value="@Model.Name" />
}
<strong>@Model.DisplayName</strong>
@if (Model.Emphasize)
{
<span class="glyphicon glyphicon-exclamation-sign"></span>
}
</label>
@if (Model.Required)
{
<span><em>(required)</em></span>
}
@if (Model.Description != null)
{
<div class="consent-description">
<label for="scopes_@Model.Name">@Model.Description</label>
</div>
}
</li>