I'm trying to use AddCustomAuthorizeRequestValidator method to provide custom claims validation. I can't even get a breakpoint to be hit in the ICustomAuthorizeRequestValidator implementation. Have I missing something?
My breakpoint
ConfigureServices method code:
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);
Depending on how IdentityServer is structuring things, is it possible that this is due to where you're adding that call?
If IdentityServer is building a middleware pipeline directly from what you're adding, it's possible that it might be handled before it reaches that point in the pipeline.
Curious as to whether you had any luck resolving this.
use below code in your startup.cs
services.RemoveAll<IdentityServer4.Validation.ICustomAuthorizeRequestValidator>();
services.AddTransient<IdentityServer4.Validation.ICustomAuthorizeRequestValidator, UserManagementApiCustomAuthorizeRequestValidator>();
worked for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With