无法 运行 IdentityServer 4 (.Net core 3.1) with MVC (.Net core MVC 3.1)

Unable to run IdentityServer 4 (.Net core 3.1) with MVC (.Net core MVC 3.1)

我正在尝试在 .Net core 3.1 中实现 IdentityServer4

我在调试中收到以下消息 window:

IdentityServer4.Hosting.IdentityServerMiddleware: Information: Invoking IdentityServer endpoint:         IdentityServer4.Endpoints.AuthorizeEndpoint for /connect/authorize
IdentityServer4.Validation.AuthorizeRequestValidator: Error: Invalid redirect_uri:          https://localhost:44388/signin-oidc
   {
     "ClientId": "testClient",
     "ClientName": "Security.Client",
     "AllowedRedirectUris": [
     "http://localhost:44388/siginin-oidc"
  ],
  "SubjectId": "anonymous",
  "RequestedScopes": "",
   "Raw": {
  "client_id": "testClient",
  "redirect_uri": "https://localhost:44388/signin-oidc",
  "response_type": "code id_token",
  "scope": "openid profile offline_access",
  "response_mode": "form_post",
  "nonce": "637208292641572630.ODk4NzdjNWEtMzNhOC00MmMwLThlNDAtZDc4YzcxZGUxMjM5MjMyMmU5NzUtY2IwNC00Zjg2LThmZDUtNmNlNDM3YjI0ODNk",    "state": "CfDJ8AywpzlcvXBBkeIc2klEDRx1T9KQXlL4fQ9H23M0c-gOdQy9WdjC9EQo0uStq6ANZoCuVLa3e2za0THaInRuEE0OoHYCwORHlJIbv08hV_NSQl94TZTA80t-sxmwQuLyGq5t5kIO4n8e39YUlQKn3A5ybfO9jf-1Ryu1vn2cdZwMxpSfzkoCSq7OsZB_eOfqItU1UlahnUzizJTabGQamFfJKqT1kx5PvxY4NZEldrixJ1oy6RULk5xRhwf6awC5vQf7jds8PU9n7EPUB-yIX-TXXlhLEPPrGyleCiiqQV94",
  "x-client-SKU": "ID_NETSTANDARD2_0",
  "x-client-ver": "5.5.0.0"
     }
    }

我的UI是.Net core 3.1 MVC

我的 IdentityServer url 显示为 http://localhost:44387/

单击发现文档 link 我可以在下方看到

截至目前,我添加了 Hardcode 客户端和 2 个用户:

下面是我的服务器文件夹结构。 wwwroot, QuickStart, Views文件夹我直接从urlhttps://github.com/IdentityServer/IdentityServer4.Quickstart.UI

复制粘贴过来的

在我的 MVC 方面:

在主页上我添加了一个 link 来调用登录操作

我的 MVC url 是 https://localhost:44388/ 现在,当我点击 Signin 时,它肯定会转到 Login 操作

然后显示以下错误页面:

更改您客户端的配置。 AllowedRedirectUris 与请求的 url

不匹配
"AllowedRedirectUris": [
 "http://localhost:44388/siginin-oidc"

]

您应该将 http 更改为 https,这样就可以了。