0
ユーザー登録プロセスに関連するカスタム画面がIdentity Server 3にあります。それらはMVCを使用して実装されています。ビューとモデルを備えたコントローラをいくつか追加しました。 - Autofac Identity Server 3のMVCコントローラでDIを使用できません
private readonly IMailDeliveryService _mailDeliveryService;
public CreateUserAccountController(IMailDeliveryService mailDeliveryService)
{
this._mailDeliveryService = mailDeliveryService;
}
は、私は彼らが持っている「アウト・オブ・ボックスの」依存リゾルバを使用:私は次のように私は私のコントローラにいくつかの依存関係を注入したいポイントに達しています。
app.Map("/identity", idsrvApp =>
{
var corsPolicyService = new DefaultCorsPolicyService()
{
AllowAll = true
};
var idServerServiceFactory = new IdentityServerServiceFactory()
.UseInMemoryClients(Clients.Get())
.UseInMemoryScopes(Scopes.Get());
// ...
idServerServiceFactory.Register(new Registration<IMailDeliveryService, MailDeliveryService>());
var options = new IdentityServerOptions
{
Factory = idServerServiceFactory,
// ...
},
// ...
};
idsrvApp.UseIdentityServer(options);
});
私は要求を作成し、私のコントローラをinstatiateしようとしようとすると、私が得る:
IdentityServer.Controllers.CreateUserAccountController'. Make sure that the controller has a parameterless public constructor.
私は問題はMVCとOWInが異なるパイプラインのようなものが、わからないを持っていることであると信じています。