IdentitySeverのAddIdentityServerなにやっているのか?(工事中

AddIdentityServer

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

[やっていること]

AddCookieAuthentication

[やっていること]

  • IdentityServerでの認証用のCookie名をidsrvでデフォルト名として設定
  • IdentityServerでの外部認証用のCookie名をidsrv.externalでデフォルト名として設定
  • CookieAuthenticationOptionsの設定反映:
  • PostConfigureCookieAuthenticationOptionsの設定
    • ログイン/ログアウトクッキー認証オプションの設定
      • LoginPath
        • 認証が必要なリソースに未認証のユーザーがアクセスした場合にリダイレクトされるログインページのパスを指定します。
      • LoginReturnUrlParameter
        • CallBackするときのクエリパラメータを指定します。
      • LogoutUrl
        • ログアウトページのパスを指定します。
  • ユーザーのサインインとサインアウトを追跡し、Identity Serverの機能をサポートするための認証サービスを設定

  • フェデレーテッドサインアウト(複数の異なるシステムやアプリケーション間での一括ログアウト)を管理設定

[内部的に呼び出しているメソッド]