Activities of "granade"

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'm using the code below to set my Entra ID values. I'm using AbpExternalProviderOptions instead of WithDynamicOptions so I can set the Tenant ID in the web gui and then build the Authority URL. The values get set in the database but how do we retrieve the "EntraId" ExternalProviderDefinition so we can access those property values when setting the OpenIdConnection options when using ABP Pro?

` Configure(options => { options.Definitions.Add(new ExternalProviderDefinition { Name = "EntraId", Properties = new List { new ExternalProviderDefinitionProperty { PropertyName = "ClientId", IsSecret = false }, new ExternalProviderDefinitionProperty { PropertyName = "ClientSecret", IsSecret = true }, new ExternalProviderDefinitionProperty { PropertyName = "CallbackPath", IsSecret = false }, new ExternalProviderDefinitionProperty { PropertyName = "DisplayName", IsSecret = false }, new ExternalProviderDefinitionProperty { PropertyName = "Enabled", IsSecret = false },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

What's the best way to set the value of a navigational property so the create and edit always have that value. Here's an example. I have a Dealership entity and a Leads entity. Leads has a required navigational property of DealershipId. Here's what I have working.

On the Dealerships razor page, I added and EntityAction.

<EntityAction TItem="DealershipDto" Visible="@CanEditDealership" Clicked="async () => await NavigateToLeads(context)" Text="@L["Leads"]"></EntityAction>

In Dealerships.Extended.razor.cs I added

private Task NavigateToLeads(DealershipDto dealership) { NavigationManager.NavigateTo($"/leads?DealershipId={dealership.Id}"); return Task.CompletedTask; }

Then in LeadsAppService.Extended.cs, I have public async Task\<PagedResultDto> GetListByDealershipAsync(Guid dealershipId, PagedAndSortedResultRequestDto input) { var filterInput = new GetLeadsInput { DealershipId = dealershipId, Sorting = input.Sorting, MaxResultCount = input.MaxResultCount, SkipCount = input.SkipCount };

return await GetListAsync(filterInput); }

This works and gives me a new button to add a lead filtered on the selected dealership.

I tried following the guide in this article but all I could get to work was add buttons not removing or editing.

#1: Is this the best way to do this or is there an obvious "ABP way" that I'm missing?

#2 If it is the best way, how do I disable/hide the default create button (New Lead below)?

#3 On create and edit, how do I hide/disable the Dealership selector as we don't want any chance of it being changed before saving.

The answer to #1 may make questions 2 and 3 moot. Thanks for any help.

John

Thanks.

Sorry about that, yes...when using ABP Suite. Below you'll see Year and Mileage have default values. But if you check required on a property as I did on Year, the default value isn't populated. Uncheck Required and it starts populating the default value again.

  • ABP Framework version: v0.9.23
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): No
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

If you Save and Generate a property with a default value, the value will be set on new entries as long as Required isn't checked. If Required is checked, the default value isn't populated when creating a new record. If you uncheck Required and Save and Generate, Default Value will again be set when creating a new record.

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.

Showing 1 to 10 of 11 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20