小编pav*_*any的帖子

从令牌服务器(身份服务器 4)进行身份验证后,重定向到客户端的相同 URL

我正在使用 Identity server 4 进行用户身份和令牌服务。我的客户端应用程序是用 .Net core React 模板编写的。一切工作正常,但是当最终用户点击客户端子 URL 页面(从电子邮件接收)时,它会重定向到 STS 身份服务器进行身份验证并返回主页,而不是返回用户点击 URL 中的子页面。乞讨。

例如,当用户点击客户端 URL ( https://localhost:44309/bills)(通过电子邮件接收)时,它将进入登录页面 ( https://localhost:44318/Login ),并且在用户身份验证后,它将重定向到( https://localhost:44309/Home ) 而不是 ( https://localhost:44309/bills )。

我使用 Identity server 4 编写的代码类似于下面的链接

https://github.com/damienbod/IdentityServer4AspNetCoreIdentityTemplate/tree/master/content/StsServerIdentity

身份服务器添加客户端


{
        "ClientId": "reactclient",
        "ClientName": "React Client",
        "Enabled": true,
        "RequireClientSecret": false,
        "EnableLocalLogin": true,
        "RequireConsent": false,
        "AllowedGrantTypes": [ "authorization_code", "hybrid", "client_credentials" ],
        "RedirectUris": [ "https://localhost:44309/signin-oidc" ],
        "PostLogoutRedirectUris": [ "https://localhost:44309/logout/callback" ],
        "AccessTokenType": "Jwt",
        "AllowAccessTokensViaBrowser": true,
        //"UpdateAccessTokenClaimsOnRefresh": true,
        "AllowOfflineAccess": true,
        "AccessTokenLifetime": 14400,
        "IdentityTokenLifetime": 7200,
        "AllowedScopes": [
          "openid",
          "profile", …
Run Code Online (Sandbox Code Playgroud)

reactjs asp.net-core identityserver4

5
推荐指数
1
解决办法
2822
查看次数

标签 统计

asp.net-core ×1

identityserver4 ×1

reactjs ×1