久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='BamH6'></tfoot>

<small id='BamH6'></small><noframes id='BamH6'>

  • <legend id='BamH6'><style id='BamH6'><dir id='BamH6'><q id='BamH6'></q></dir></style></legend>

      • <bdo id='BamH6'></bdo><ul id='BamH6'></ul>
      1. <i id='BamH6'><tr id='BamH6'><dt id='BamH6'><q id='BamH6'><span id='BamH6'><b id='BamH6'><form id='BamH6'><ins id='BamH6'></ins><ul id='BamH6'></ul><sub id='BamH6'></sub></form><legend id='BamH6'></legend><bdo id='BamH6'><pre id='BamH6'><center id='BamH6'></center></pre></bdo></b><th id='BamH6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BamH6'><tfoot id='BamH6'></tfoot><dl id='BamH6'><fieldset id='BamH6'></fieldset></dl></div>

        Identity Server 4:向訪問令牌添加聲明

        Identity Server 4: adding claims to access token(Identity Server 4:向訪問令牌添加聲明)
      2. <legend id='GqMaF'><style id='GqMaF'><dir id='GqMaF'><q id='GqMaF'></q></dir></style></legend>

          <tfoot id='GqMaF'></tfoot>
          • <bdo id='GqMaF'></bdo><ul id='GqMaF'></ul>

                  <tbody id='GqMaF'></tbody>
                <i id='GqMaF'><tr id='GqMaF'><dt id='GqMaF'><q id='GqMaF'><span id='GqMaF'><b id='GqMaF'><form id='GqMaF'><ins id='GqMaF'></ins><ul id='GqMaF'></ul><sub id='GqMaF'></sub></form><legend id='GqMaF'></legend><bdo id='GqMaF'><pre id='GqMaF'><center id='GqMaF'></center></pre></bdo></b><th id='GqMaF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GqMaF'><tfoot id='GqMaF'></tfoot><dl id='GqMaF'><fieldset id='GqMaF'></fieldset></dl></div>
              • <small id='GqMaF'></small><noframes id='GqMaF'>

                  本文介紹了Identity Server 4:向訪問令牌添加聲明的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在使用 Identity Server 4 和隱式流,并想向訪問令牌添加一些聲明,新的聲明或屬性是tenantId"和langId".

                  I am using Identity Server 4 and Implicit Flow and want to add some claims to the access token, the new claims or attributes are "tenantId" and "langId".

                  我已將 langId 添加為我的范圍之一,如下所示,然后通過身份服務器請求它,但我也得到了tenantId.怎么會這樣?

                  I have added langId as one of my scopes as below and then requesting that through identity server, but i get the tenantId also. How can this happen?

                  這是范圍和客戶端配置的列表:

                  This the list of scopes and client configuration:

                    public IEnumerable<Scope> GetScopes()
                      {
                          return new List<Scope>
                          {
                               // standard OpenID Connect scopes
                              StandardScopes.OpenId,
                              StandardScopes.ProfileAlwaysInclude,
                              StandardScopes.EmailAlwaysInclude,
                  
                              new Scope
                              {
                                  Name="langId",
                                   Description = "Language",
                                  Type= ScopeType.Resource,
                                  Claims = new List<ScopeClaim>()
                                  {
                                      new ScopeClaim("langId", true)
                                  }
                              },
                              new Scope
                              {
                                  Name = "resourceAPIs",
                                  Description = "Resource APIs",
                                  Type= ScopeType.Resource
                              },
                              new Scope
                              {
                                  Name = "security_api",
                                  Description = "Security APIs",
                                  Type= ScopeType.Resource
                              },
                          };
                      }
                  

                  客戶:

                    return new List<Client>
                          {
                              new Client
                              {
                                  ClientName = "angular2client",
                                  ClientId = "angular2client",
                                  AccessTokenType = AccessTokenType.Jwt,
                                  AllowedGrantTypes = GrantTypes.Implicit,
                                  AllowAccessTokensViaBrowser = true,
                                  RedirectUris = new List<string>(redirectUris.Split(',')), 
                                  PostLogoutRedirectUris = new List<string>(postLogoutRedirectUris.Split(',')),
                                  AllowedCorsOrigins = new List<string>(allowedCorsOrigins.Split(',')),
                  
                                  AllowedScopes = new List<string>
                                  {
                                     "openid",
                                     "resourceAPIs",
                                     "security_api",         
                                     "role",
                                    "langId"
                                  }
                              }
                          };
                  

                  我已在 ProfileService 中添加聲明:

                  I have added the claims in the ProfileService:

                   public class ProfileService : IdentityServer4.Services.IProfileService
                  {
                      private readonly SecurityCore.ServiceContracts.IUserService _userService;
                  
                  
                      public ProfileService(SecurityCore.ServiceContracts.IUserService userService)
                      {
                          _userService = userService;
                      }
                  
                      public Task GetProfileDataAsync(ProfileDataRequestContext context)
                      {
                         //hardcoded them just for testing purposes
                          List<Claim> claims = new List<Claim>() { new Claim("langId", "en"), new Claim("tenantId", "123") };
                  
                          context.IssuedClaims = claims;
                  
                  
                          return Task.FromResult(0);
                      }
                  

                  這就是我要獲取令牌的請求,問題是我只請求 langId 但我同時獲得了 tenantIdlangId 在訪問令牌中

                  This is what i am requesting to get the token, the problem is i am only requesting the langId but I am getting both the tenantId and langId in the access token

                  http://localhost:44312/account/login?returnUrl=%2Fconnect%2Fauthorize%2Flogin%3Fresponse_type%3Did_token%2520token%26client_id%3Dangular2client%26redirect_uri%3Dhttp%253A%252F%252Flocalhost:5002%26scope%3DresourceAPIs%2520notifications_api%2520security_api%2520langId%2520navigation_api%2520openid%26nonce%3DN0.73617935552798141482424408851%26state%3D14824244088510.41368537145696305%26
                  

                  解碼的訪問令牌:

                   {
                    "nbf": 1483043742,
                    "exp": 1483047342,
                    "iss": "http://localhost:44312",
                    "aud": "http://localhost:44312/resources",
                    "client_id": "angular2client",
                    "sub": "1",
                    "auth_time": 1483043588,
                    "idp": "local",
                    "langId": "en",
                    "tenantId": "123",
                    "scope": [
                      "resourceAPIs",     
                      "security_api",
                      "langId",
                      "openid"
                    ],
                    "amr": [
                      "pwd"
                    ]
                  }
                  

                  推薦答案

                  你應該檢查 context.RequestedClaimTypes 并過濾掉未請求的聲明.

                  You should check context.RequestedClaimTypes and filter out claims, that were not requested.

                  這篇關于Identity Server 4:向訪問令牌添加聲明的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數調用按鈕 OnClick)

                      • <legend id='mVWHh'><style id='mVWHh'><dir id='mVWHh'><q id='mVWHh'></q></dir></style></legend>

                        <small id='mVWHh'></small><noframes id='mVWHh'>

                        1. <i id='mVWHh'><tr id='mVWHh'><dt id='mVWHh'><q id='mVWHh'><span id='mVWHh'><b id='mVWHh'><form id='mVWHh'><ins id='mVWHh'></ins><ul id='mVWHh'></ul><sub id='mVWHh'></sub></form><legend id='mVWHh'></legend><bdo id='mVWHh'><pre id='mVWHh'><center id='mVWHh'></center></pre></bdo></b><th id='mVWHh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mVWHh'><tfoot id='mVWHh'></tfoot><dl id='mVWHh'><fieldset id='mVWHh'></fieldset></dl></div>
                          • <bdo id='mVWHh'></bdo><ul id='mVWHh'></ul>

                              <tbody id='mVWHh'></tbody>
                            <tfoot id='mVWHh'></tfoot>

                            主站蜘蛛池模板: av在线播放不卡 | 亚洲精品一区中文字幕乱码 | 99久久久久国产精品免费 | 日本在线视频一区二区 | 夜久久| 午夜免费视频 | 成人av在线大片 | 亚洲成av人影片在线观看 | 超碰人人插 | 久久久久久国产精品免费免费 | 欧美自拍另类 | 免费国产一区二区 | 国产精品久久久久aaaa九色 | 亚洲免费在线 | 成人精品鲁一区一区二区 | 国产91在线 | 欧美 | 亚洲欧美在线观看 | 国产99久久精品一区二区永久免费 | 精品久久国产 | 欧美视频一区 | 一区二区免费高清视频 | 国产日韩欧美一区 | 欧美日韩精品国产 | 日本成人在线免费视频 | 成人av播放 | 玖玖操 | 午夜精品一区二区三区免费视频 | 日韩一区二区三区视频 | 精品1区 | 国产日韩精品一区二区三区 | 欧美一区二区小视频 | 国产成人福利 | 香蕉久久av | 亚洲+变态+欧美+另类+精品 | 狠狠操电影 | 国产免费一区二区三区 | 成人av一区二区三区 | 欧美成视频 | 超碰免费在线观看 | 在线一区视频 | 日韩国产黄色片 |