pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

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

      <legend id='Rpj76'><style id='Rpj76'><dir id='Rpj76'><q id='Rpj76'></q></dir></style></legend>

      <i id='Rpj76'><tr id='Rpj76'><dt id='Rpj76'><q id='Rpj76'><span id='Rpj76'><b id='Rpj76'><form id='Rpj76'><ins id='Rpj76'></ins><ul id='Rpj76'></ul><sub id='Rpj76'></sub></form><legend id='Rpj76'></legend><bdo id='Rpj76'><pre id='Rpj76'><center id='Rpj76'></center></pre></bdo></b><th id='Rpj76'></th></span></q></dt></tr></i><div class="ay2geug" id='Rpj76'><tfoot id='Rpj76'></tfoot><dl id='Rpj76'><fieldset id='Rpj76'></fieldset></dl></div>
        <bdo id='Rpj76'></bdo><ul id='Rpj76'></ul>
      <tfoot id='Rpj76'></tfoot>

        自己發行 JWT 令牌與使用 IdentityServer4(OIDC) 進行

        Issuing JWT token myself versus using IdentityServer4(OIDC) for Web API(自己發行 JWT 令牌與使用 IdentityServer4(OIDC) 進行 Web API)
        <tfoot id='VkW7T'></tfoot>

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

              • <i id='VkW7T'><tr id='VkW7T'><dt id='VkW7T'><q id='VkW7T'><span id='VkW7T'><b id='VkW7T'><form id='VkW7T'><ins id='VkW7T'></ins><ul id='VkW7T'></ul><sub id='VkW7T'></sub></form><legend id='VkW7T'></legend><bdo id='VkW7T'><pre id='VkW7T'><center id='VkW7T'></center></pre></bdo></b><th id='VkW7T'></th></span></q></dt></tr></i><div class="iwmcsws" id='VkW7T'><tfoot id='VkW7T'></tfoot><dl id='VkW7T'><fieldset id='VkW7T'></fieldset></dl></div>
                • <bdo id='VkW7T'></bdo><ul id='VkW7T'></ul>
                  <legend id='VkW7T'><style id='VkW7T'><dir id='VkW7T'><q id='VkW7T'></q></dir></style></legend>
                    <tbody id='VkW7T'></tbody>
                  本文介紹了自己發行 JWT 令牌與使用 IdentityServer4(OIDC) 進行 Web API的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我真正想要實施以保護我的 Web API:

                  • 登錄
                  • 注銷(使令牌無效?)
                  • 沒有同意屏幕(只想為我自己提供 API),身份驗證在我的原生桌面、移動、網絡應用程序的后臺進行(無重定向)
                  • 記住我功能(刷新令牌?)

                  誰能幫我清除一下 OIDC/OAuth2 的模糊畫面?即給我一些我自己的方式的缺點(實現我自己的流程)和使用 OIDC 代替我自己的流程的優勢.

                  它將使我以后免于做什么(例如在客戶端),什么不會.尤其是,使用 OIDC 等標準流程開始每個項目是否合適?將來它會以某種方式使我受益嗎?

                  解決方案

                  無論如何你都會實現 OAuth2.將 Oidc 視為 OAuth2 的擴展.要記住的最重要的事情是關注點分離.

                  忘記 Oidc,Identity Server 4 就是關于身份驗證的:誰是用戶"?考慮谷歌登錄.當用戶第一次登錄時,應用程序不認識該用戶,它只知道 Google 認識.

                  授權發生在不同的級別上,并不是 IdentityServer 真正關心的問題.為此,您可以查看 PolicyServer.

                  因此,您需要將用戶數據庫與應用程序數據庫分開.這并不意味著您需要另一個數據庫,只是不要混合上下文.如果您與業務環境"有關系,例如身份上下文"中的用戶表,那么您最終會遇到問題.

                  在您的設置中,您的 web api 既是 資源 又是 身份提供者.這意味著您創建的每個新 Web api 都必須作為資源和身份提供者來實現.為了可維護性,您可以創建一個單獨的 web api 作為身份提供者,而 web api 只是一個資源.只要所有應用程序都可以讀取令牌,您就可以實現類似的東西.

                  前面也一樣.為什么前面要和用戶有關系?它需要做的就是傳遞令牌以獲得用戶授權.在 IdentityServer 的情況下,應用程序會聯系它以驗證用戶并接收令牌.它對憑據一無所知.這更安全.客戶端應用程序可能會受到損害.憑據可以被截取.

                  擁有具有特定關注點的單個應用程序使事情更易于維護.在使用 IdentityServer 時,無需編寫代碼即可輕松添加新資源.只需添加配置.它還允許您在將來添加目前不需要的其他流.另外,同意屏幕是可選的.

                  好處是您可以實施 SSO,在您的設置中,即使不是不可能,也可能更難.

                  因此您不必使用 IdentityServer,也不必使用 Oidc.您的設置可能很好.但是,如果您構建某些東西,請記住分離關注點.

                  https://identityserver4.readthedocs.io/en/release/intro/support.html

                  I currently issue tokens myself in my web api with JwtSecurityToken and I use standard ASP.NET Core middleware calling AddJwtBearer to verify the tokens. It works fine.

                  What advantage will give me using OpenID Connect (through IdentityServer4) over the approach described above? How to answer myself question "Do I need OpenID Connect?"

                  From my basic understanding about OpenID Connect, it is used to allow third parties to access your API. But I make API for myself and not for third parties and I don't know why should I favor IdentityServer/OpenIddict over my simple approach.

                  I read that if I want Single sign-on I should use this, but JWTs itself aren't bound to any specific domain and I can use single sign-on with just pure JWTs(they're self-contained)

                  I understand it implements some kind of standard for issuing tokens. (protocol). It might be good if I ever wish to expose some API to third parties. But for internal APIs? Is it worth using it?

                  This is my current auth flow (from https://jonhilton.net/2017/10/11/secure-your-asp.net-core-2.0-api-part-1---issuing-a-jwt/)

                  What I really want to implement to secure my Web API:

                  • Login
                  • Logout (invalidate token?)
                  • No consent screen (want to have API only for myself), auth happens in the background in my native desktop, mobile, web app (no redirection)
                  • Remember me feature (refresh tokens?)

                  Could someone clear out the fuzzy picture of OIDC/OAuth2 for me? i.e. give me some disadvantages going my own way (implementing my own flow) and advantages of using OIDC in place of my own flow.

                  What will it save me from doing later on (on the client-side for example), and what will not. And most particularly, is it good to start every project using standard flows like OIDC? Will it somehow benefit me in the future?

                  解決方案

                  In any case you will implement OAuth2. Think of Oidc as an extension of OAuth2. The most important thing to keep in mind is seperation of concerns.

                  Forget Oidc, Identity Server 4 is all about authentication: "who is the user"? Consider Google login. When a user logs in for the first time, the application doesn't know the user, it only knows that Google does.

                  Authorization takes place on a different level and isn't really a concern of IdentityServer. For that you could take a look at PolicyServer.

                  So you'll need to keep the user database seperated from the application database. This doesn't mean you need another database, just don't mix contexts. If you have a relation from the "business context" to e.g. the user table in the "Identity context" then you are going to have a problem eventually.

                  In your setup your web api is both the resource and the identity provider. This means that every new web api you create has to be implemented as both resource and identity provider. For maintainability you could create a seperate web api that acts as an identity provider, while the web api is a resource only. You can implement something like that as long as all apps can read the token.

                  The same counts for the front. Why should the front have anything to do with the user? All it needs to do is pass the token in order to get the user authorized. In case of IdentityServer, the app contacts it to verify the user and receives a token. It knows nothing about credentials. This is more secure. The client app can be compromised. The credentials can be intercepted.

                  Having single apps with a specific concern makes things more maintainable. And it is quite easy to add a new resource without having to code when you use IdentityServer. Just add the configuration. It also allows you to add other flows in the future that are not needed at this time. And as a side note, the consent screen is optional.

                  The bonus is that you can implement SSO, where in your setup that could be harder, if not impossible.

                  So you don't have to use IdentityServer, nor Oidc. Your setup may be just fine. But if you build something, keep seperation of concerns in mind.

                  這篇關于自己發行 JWT 令牌與使用 IdentityServer4(OIDC) 進行 Web API的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)

                      <tbody id='2gSr9'></tbody>
                    <tfoot id='2gSr9'></tfoot><legend id='2gSr9'><style id='2gSr9'><dir id='2gSr9'><q id='2gSr9'></q></dir></style></legend>
                    • <bdo id='2gSr9'></bdo><ul id='2gSr9'></ul>

                            <i id='2gSr9'><tr id='2gSr9'><dt id='2gSr9'><q id='2gSr9'><span id='2gSr9'><b id='2gSr9'><form id='2gSr9'><ins id='2gSr9'></ins><ul id='2gSr9'></ul><sub id='2gSr9'></sub></form><legend id='2gSr9'></legend><bdo id='2gSr9'><pre id='2gSr9'><center id='2gSr9'></center></pre></bdo></b><th id='2gSr9'></th></span></q></dt></tr></i><div class="aucawc0" id='2gSr9'><tfoot id='2gSr9'></tfoot><dl id='2gSr9'><fieldset id='2gSr9'></fieldset></dl></div>

                            <small id='2gSr9'></small><noframes id='2gSr9'>

                            主站蜘蛛池模板: 东莞螺丝|东莞螺丝厂|东莞不锈钢螺丝|东莞组合螺丝|东莞精密螺丝厂家-东莞利浩五金专业紧固件厂家 | 掺铥光纤放大器-C/L波段光纤放大器-小信号光纤放大器-合肥脉锐光电技术有限公司 | 对照品_中药对照品_标准品_对照药材_「格利普」高纯中药标准品厂家-成都格利普生物科技有限公司 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 香蕉筛|直线|等厚|弧形|振动筛|香蕉筛厂家-洛阳隆中重工 | 定量包装秤,吨袋包装称,伸缩溜管,全自动包装秤,码垛机器人,无锡市邦尧机械工程有限公司 | 东莞喷砂机-喷砂机-喷砂机配件-喷砂器材-喷砂加工-东莞市协帆喷砂机械设备有限公司 | 广东机电安装工程_中央空调工程_东莞装饰装修-广东粤标建设有限公司 | 井式炉-台车式回火炉-丹阳市电炉厂有限公司 | 航空铝型材,7系铝型材挤压,硬质阳*氧化-余润铝制品 | 杭州公司变更法人-代理记账收费价格-公司注销代办_杭州福道财务管理咨询有限公司 | 山东钢格板|栅格板生产厂家供应商-日照森亿钢格板有限公司 | 中国在职研究生招生信息网| 免费网站网址收录网_海企优网站推荐平台 | 天津试验仪器-电液伺服万能材料试验机,恒温恒湿标准养护箱,水泥恒应力压力试验机-天津鑫高伟业科技有限公司 | 琉璃瓦-琉璃瓦厂家-安徽盛阳新型建材科技有限公司 | 色谱柱-淋洗液罐-巴罗克试剂槽-巴氏吸管-5ml样品瓶-SBS液氮冻存管-上海希言科学仪器有限公司 | 电车线(用于供电给电车的输电线路)-百科 | 蓄电池在线监测系统|SF6在线监控泄露报警系统-武汉中电通电力设备有限公司 | 生物除臭剂-除味剂-植物-污水除臭剂厂家-携葵环保有限公司 | 手术室净化厂家_成都实验室装修公司_无尘车间施工单位_洁净室工程建设团队-四川华锐16年行业经验 | 深圳活动策划公司|庆典策划|专业公关活动策划|深圳艺典文化传媒 重庆中专|职高|技校招生-重庆中专招生网 | 考勤系统_考勤管理系统_网络考勤软件_政企|集团|工厂复杂考勤工时统计排班管理系统_天时考勤 | 不锈钢水箱厂家,不锈钢保温水箱-山东桑特供水设备 | 山东商品混凝土搅拌楼-环保型搅拌站-拌合站-分体仓-搅拌机厂家-天宇 | 高光谱相机-近红外高光谱相机厂家-高光谱成像仪-SINESPEC 赛斯拜克 | 德国GMN轴承,GMN角接触球轴承,GMN单向轴承,GMN油封,GMN非接触式密封 | 厂房出租-厂房规划-食品技术-厂房设计-厂房装修-建筑施工-设备供应-设备求购-龙爪豆食品行业平台 | 哈尔滨京科脑康神经内科医院-哈尔滨治疗头痛医院-哈尔滨治疗癫痫康复医院 | 国际线缆连接网 - 连接器_线缆线束加工行业门户网站 | 全球化工设备网—化工设备,化工机械,制药设备,环保设备的专业网络市场。 | 金环宇|金环宇电线|金环宇电缆|金环宇电线电缆|深圳市金环宇电线电缆有限公司|金环宇电缆集团 | 焊接减速机箱体,减速机箱体加工-淄博博山泽坤机械厂 | 水性绝缘漆_凡立水_绝缘漆树脂_环保绝缘漆-深圳维特利环保材料有限公司 | 法钢特种钢材(上海)有限公司 - 耐磨钢板、高强度钢板销售加工 阀门智能定位器_电液动执行器_气动执行机构-赫尔法流体技术(北京)有限公司 | 冷却塔厂家_冷却塔维修_冷却塔改造_凉水塔配件填料公司- 广东康明节能空调有限公司 | 酒精检测棒,数显温湿度计,酒安酒精测试仪,酒精检测仪,呼气式酒精检测仪-郑州欧诺仪器有限公司 | 合肥白癜风医院_合肥治疗白癜风医院_合肥看白癜风医院哪家好_合肥华研白癜风医院 | 校园文化空间设计-数字化|中医文化空间设计-党建|法治廉政主题文化空间施工-山东锐尚文化传播公司 | 浴室柜-浴室镜厂家-YINAISI · 意大利设计师品牌 | 咿耐斯 |-浙江台州市丰源卫浴有限公司 | 冷轧机|两肋冷轧机|扁钢冷轧机|倒立式拉丝机|钢筋拔丝机|收线机-巩义市华瑞重工机械制造有限公司 | 烟气在线监测系统_烟气在线监测仪_扬尘检测仪_空气质量监测站「山东风途物联网」 |