我正在尝试使用 AddCustomAuthorizeRequestValidator
方法来提供自定义声明验证。我什至无法在 ICustomAuthorizeRequestValidator
实现中设置断点。我错过了什么吗?
My breakpoint
ConfigureServices方法代码:
services.AddMvc();
services.AddOptions();
services.AddTransient<ICustomAuthorizeRequestValidator, Saml2BearerValidator>();
services.AddIdentityServer()
.AddTestUsers(Config.GetUsers())
.AddConfigurationStore(builder =>
builder.UseSqlServer(_settings.Value.ConnectionString, options =>
options.MigrationsAssembly(migrationsAssembly)))
.AddOperationalStore(builder =>
builder.UseSqlServer(_settings.Value.ConnectionString, options =>
options.MigrationsAssembly(migrationsAssembly)))
.AddCustomAuthorizeRequestValidator<Saml2BearerValidator>()
.AddSigningCredential(CertificateManager.GetFromStorage(
_settings.Value.ServerCertificateThumb, _settings.Value.ServerCertificatePass));
return services.ConfigureAutofacServicesProvider(_settings.Value.Abc_xacml_n3_diagnostic);
最佳答案
根据 IdentityServer 构建事物的方式,这是否可能是由于您在哪里添加了该调用?
如果 IdentityServer 直接根据您添加的内容构建中间件管道,则它可能会在到达管道中的那个点之前得到处理。
想知道您是否幸运地解决了这个问题。
关于c# - 没有调用 ICustomAuthorizeRequestValidator?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45955120/