當您使用VS 2017創建新的Web API並選擇使用「工作或學校帳戶」進行身份驗證時,您將獲得使用JwtBearerAuthentication庫的代碼。也可以手動編寫Web API以使用OpenIdConnectAuthentication庫。使用這些的主要區別是什麼?需要根據API(服務器)端使用的庫,或者客戶端是否可以兼容保護API的兩種方式來爲客戶端編寫特定/不同的代碼?UseJwtBearerAuthentication與UseOpenIdConnectAuthentication?
1
A
回答
0
我試圖使用「工作或學校帳戶」生成ASP.NET核心Web應用程序,生成的代碼包含UseOpenIdConnectAuthentication。然後我在web apoplication中實現了一些代碼,用不記名令牌調用Web API,並且一切正常。
+0
你實現了什麼代碼來讓WebApi使用令牌? – Castrohenge
+1
我使用了VS 2017的標準ASP.NET MVC網頁模板,並選擇了更改身份驗證到「工作或學校帳戶」。 – OlavT
相關問題
- 1. 與UseJwtBearerAuthentication
- 2. AspNetCore UseOpenIdConnectAuthentication
- 3. 使用UseJwtBearerAuthentication
- 4. UseOpenIdConnectAuthentication殺死回發
- 5. asp.net webapi UseOAuthBearerAuthentication vs UseJwtBearerAuthentication
- 6. 需要使用哪個TokenValidationParameters和UseJwtBearerAuthentication
- 7. UseJwtBearerAuthentication令牌期滿返回HTTP 500
- 8. 如何在UseJwtBearerAuthentication中指定多個IssuerSigningKey?
- 9. UseOpenIdConnectAuthentication - 無法解除郵件保護。狀態錯誤信息
- 10. UseJwtBearerAuthentication失敗,IDX10504:無法驗證簽名,令牌沒有簽名
- 11. UseJwtBearerAuthentication失敗:未經授權的令牌和簽名無效
- 12. 使用UseJwtBearerAuthentication中間件的自定義401和403響應模型
- 13. UseOpenIdConnectAuthentication之後,如何將來自Security Token的聲明放入OwinConext.User中的Controller.User(Current HttpContext)中?
- 14. 使用OpenIDConnect在Azure AD應用程序中回覆URL
- 15. 使用SPA對SPA進行身份驗證,然後在Web API中使用令牌
- 16. 使用ADAL索賠轉換
- 17. 使用JWT令牌實現身份驗證和授權
- 18. Symfony2與KnpGaufrette與S3與LiipImagine
- 19. Identity Server的3單點登錄
- 20. 與A2X與ZIP
- 21. 檢索用戶聲稱
- 22. VHDL與選與「和」
- 23. OpenGL:isampler2DArray與sampler2DArray與sampler3DArray
- 24. QBoxLayout與QMainWindow與QWidget
- 25. PdfpTable與表(與SimpleTable?)
- 26. InsertionSort與InsertionSort與BinaryInsertionSort
- 27. ScalatraServlet與AkkaSupport與GZipSupport
- 28. JFileChooser與JDialog與FileDialog
- 29. SortedList與SortedDictionary與Sort()
- 30. H264與RTP與Facetime
請參閱http://stackoverflow.com/questions/1087031/whats-the-difference-between-openid-and-oauth和https://security.stackexchange.com/questions/37818/why-use-openid -connect-instead-of-plain-oauth – abatishchev