私は、KestrelとIISIntegrationを使用するように設定されたIdentity Server(Identity Server 4 2.0.0のASP.NET Core 2)を、launchSettings.jsonで匿名認証とWindows認証の両方を有効にして使用しています。私はまた、このようIISOptionsに構成:Windows認証で資格情報が受け入れられない
services.Configure<IISOptions>(iis =>
{
iis.AutomaticAuthentication = false;
iis.AuthenticationDisplayName = "Windows";
});
services.AddAuthentication();
services.AddCors()
.AddMvc();
services.AddIdentityServer(); // with AspNetIdentity configured
app.UseAuthentication()
.UseIdentityServer()
.UseStaticFiles()
.UseCors(options => options.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin())
.UseMvcWithDefaultRoute();
そして私は
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddOpenIdConnect(config =>
{
config.Authority = "http://localhost:5000";
config.RequireHttpsMetadata = false;
config.ClientId = "MyClientId";
config.ClientSecret = "MyClientSecret";
config.SaveTokens = true;
config.GetClaimsFromUserInfoEndpoint = true;
});
services.AddMvc();
のIdentity Server(IISIntegrationとケストレル上で実行して、Windowsと匿名認証が有効の両方でも、ASP.NETコア2)このクライアントを持っていますhttp://localhost:5000で、クライアントはhttp://localhost:2040で実行されています。
クライアントを起動すると、Identity Serverのログイン画面が正しく表示されますが、Windows認証をクリックすると、資格情報の入力を求められます。私は両方のアプリケーションのOutput Windowを見てきましたが、いずれの面でも例外はありません。私はIdentity ServerをIISサーバー(Windows認証を有効にし、そのプールをNETWORK SERVICEで実行している)に展開しようとしましたが、同じ動作が再現されています。
あなたは' services.AddDeveloperSigningCredential()を設定しようとしたことがあり@CodeCaster:
簡単にするため、ここではユーザストアとして
Identity
を使用するように変更Windows認証が可能になりますクイックスタート・コードは、ありますか? – Kostya@KostyaKあなたが 'services.AddIdentityServer()。AddDeveloperSigningCredential()'を参照している場合、それは既に存在します。 –
@CodeCaster公式のサンプルはhttps://github.com/IdentityServer/IdentityServer4.Samples/tree/から実行してみてくださいrelease/Quickstarts/6_AspNetIdentity/srcを実行して、ご使用の環境で動作するかどうかを確認してください。この方法で、問題の検索を絞り込むことができます。 – Kostya