apache netbeans改中文,.net core 中 Identity Server 4 Topic 之 Startup

 2023-12-06 阅读 19 评论 0

摘要:約定 簡稱 Id4。 Id4在.net core 中的使用符合.net core 的約定架構,即Services來注冊服務,middleware方式集成。 1. 配置服務 apache netbeans改中文?通過DI注入: public void ConfigureServices(IServiceCollection services) {var builder = ser

約定 簡稱 Id4。

Id4在.net core 中的使用符合.net core 的約定架構,即Services來注冊服務,middleware方式集成。

1. 配置服務

apache netbeans改中文?通過DI注入:

public void ConfigureServices(IServiceCollection services)
{var builder = services.AddIdentityServer();
}

也可以使用選項模式,配置更多的參數。

            services.AddIdentityServer((ops) =>{ops.Endpoints.EnableDiscoveryEndpoint = true})

1. 2 Key material

  • AddSigningCredential
    添加簽名證書服務提供token的創建/驗證。
  • AddTemporarySigningCredential
    創建臨時簽名證書服務。用于DEV環境下沒有證書可用的時候。
  • AddDeveloperSigningCredential
  • AddValidationKeys
    Adds keys for validating tokens. They will be used by the internal token validator and will show up in the discovery document. This is useful for key roll-over scenarios.

1. 3 In-Memory configuration stores

內存數據庫,存儲等。

  • AddInMemoryClients
    注冊內存環境的Client。
  • AddInMemoryIdentityResources
    注冊內存環境的IdentityResource 。
  • AddInMemoryApiResources
    定義內存環境中的Api資源。

1. 4 Test Stores

net core和net framework的區別,用于非生產環境下的開發。默認的quickstart UI下。

  • AddTestUsers

1. 5 額外的服務

  • AddExtensionGrantValidator
  • AddSecretParser
  • AddSecretValidator
  • AddResourceOwnerValidator
  • AddProfileService
  • AddAuthorizeInteractionResponseGenerator
  • AddCustomAuthorizeRequestValidator
  • AddCustomTokenRequestValidator

1.6 緩存

  • AddClientStoreCache
  • AddResourceStoreCache

實現了 ICache接口。

2. 配置管道

public void Configure(IApplicationBuilder app)
{app.UseIdentityServer();
}

中間件的方式集成Id4.

net core dapper、轉載于:https://www.cnblogs.com/pengzhen/p/7084942.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/1/191626.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息