public static IIdentityServerBuilder AddIdentityServer(this IServiceCollection services)
{
    var builder = services.AddIdentityServerBuilder();
    builder
        .AddRequiredPlatformServices()
        .AddCookieAuthentication()
        .AddCoreServices()
        .AddDefaultEndpoints()
        .AddPluggableServices()
        .AddKeyManagement()
        .AddDynamicProvidersCore()
        .AddOidcDynamicProvider()
        .AddValidators()
        .AddResponseGenerators()
        .AddDefaultSecretParsers()
        .AddDefaultSecretValidators();
    // provide default in-memory implementations, not suitable for most production scenarios
    builder.AddInMemoryPersistedGrants();
    builder.AddInMemoryPushedAuthorizationRequests();
    return builder;
}
AddRequiredPlatformServices
[やっていること]
- HttpClient/IHttpContextAccessorIdentityServerOptions(IdentityServerの最上位設定)を準備している。
AddCookieAuthentication
[やっていること]
- IdentityServerでの認証用のCookie名をidsrvでデフォルト名として設定
- IdentityServerでの外部認証用のCookie名をidsrv.externalでデフォルト名として設定
- CookieAuthenticationOptionsの設定反映:
- PostConfigureCookieAuthenticationOptionsの設定
    - ログイン/ログアウトクッキー認証オプションの設定
        - LoginPath
            - 認証が必要なリソースに未認証のユーザーがアクセスした場合にリダイレクトされるログインページのパスを指定します。
 
- LoginReturnUrlParameter
            - CallBackするときのクエリパラメータを指定します。
 
- LogoutUrl
            - ログアウトページのパスを指定します。
 
 
- LoginPath
            
 
- ログイン/ログアウトクッキー認証オプションの設定
        
- 
    ユーザーのサインインとサインアウトを追跡し、Identity Serverの機能をサポートするための認証サービスを設定 
- 
    フェデレーテッドサインアウト(複数の異なるシステムやアプリケーション間での一括ログアウト)を管理設定
[内部的に呼び出しているメソッド]