When I use WithDynamicOptions, I have issues that I don't have when using appsettings. I'll start with just ClientId. If I pull from appsettings, it works but if I remark out that line and use the Dynamic Option stored in the gui, I get the error "SecurityTokenInvalidAudienceException: IDX10208: Unable to validate audience. validationParameters.ValidAudience is null or whitespace and validationParameters.ValidAudiences is null." My end goal is to only set ClientId, ClientSecret, and TenantId in the dynamic External Provider properties. Then with TenantId, I'll build the Authority but could use help on how to do that.
.AddOpenIdConnect("EntraId", "Microsoft Entra Id", options =>
{
options.Authority = configuration["Authentication:EntraId:Instance"] + configuration["Authentication:EntraId:TenantId"] + "/v2.0/";
//options.ClientId = configuration["Authentication:EntraId:ClientId"];
options.ClientSecret = configuration["Authentication:EntraId:ClientSecret"];
options.CallbackPath = configuration["Authentication:EntraId:CallbackPath"];
options.ResponseType = OpenIdConnectResponseType.Code;
options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Clear();
options.Scope.Add("openid");
options.Scope.Add("profile");
options.Scope.Add("email");
options.ReturnUrlParameter = "returnUrl";
})
.WithDynamicOptions<OpenIdConnectOptions, OpenIdConnectHandler>("EntraId", options =>
{
options.WithProperty(o => o.ClientId);
options.Properties.Add(new ExternalProviderDefinitionProperty
{
PropertyName = "TenantId",
IsSecret = false
});
})
I figured out how to add it from extended file. I missed that I needed a new class that inherits from my entity's base class. What really confused me was in the documentation it provides this article. But this article was the key article as it provided the key info about creating a new class. Based on that articles breadcrumb, I'm not sure it's linked up correctly. I found it by searching and it really helped.
For anyone else, I'm not sure we can disable toolbar buttons. But once you override and wait for SetToolbarItemsAsync, you can then clear and add back the buttons you need.
protected override async ValueTask SetToolbarItemsAsync()
{
Toolbar.Contributors.Clear();
Toolbar.AddButton("Import users from excel", () =>
{
//TODO: Write your custom code
return Task.CompletedTask;
}, "file-import", Blazorise.Color.Secondary);
}
<br>
Thanks for the suggestions. Is there a way to add my toolbar buttons in the extended.razor.cs so it doesn't get overwritten if we use ABP Suite to make changes later?
On question #2, I'm not trying to change the order but the visibility. Is there a way to hide or disable the default Create button?
Thanks,
John
Thanks.
That's what I needed. My bad, I was looking all over and missed what was right in front of me. Thanks.
Yes, created by ABP Modules using ABP Suite. Specifically, we have a SQL column storing XML templates with variables in it that get populated when requested by an API. So, we need to be able to edit those templates (text areas) but they are so large we don't want to display them on the data grid. In this quick example, we don't want to show the column 'full description' in the attached image.
Instead, when we edit, then we would want Full Description to be a separate Tab on that form to be edited but not on the datagrid.