Turns out I also needed to add
app.UseForwardedHeaders();
above most everything in PreConfigureServices() and that solved another error. Claude Code helped me find that. Didn't seem to be documented anywhere.
Ok I got it running on 9.1.3 the same way. Creating and running a migration
I confirmed that 10.0.2 worked (on Blazor Server) after adding and running a migration.
I'm using [DependsOn(typeof(ChatBlazorServerModule))]. In my mind that should take care of everything mentioned above!
It looks like I needed to give chat permissions to the admin role. That got the icon showing but now I'm getting this error.
Antiforgery token validation failed. The required antiforgery header value "RequestVerificationToken" is not present. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery header value "RequestVerificationToken" is not present. at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.NegotiateAsync(Uri url, HttpClient httpClient, ILogger logger, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.GetNegotiationResponseAsync(Uri uri, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsyncCore(TransferFormat transferFormat, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsync(TransferFormat transferFormat, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken) at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncCore(CancellationToken cancellationToken) at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncInner(CancellationToken cancellationToken) at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsync(CancellationToken cancellationToken) at Volo.Chat.Blazor.Components.MessagesToolbarItem.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)[12:38:11 INF] Antiforgery token validation failed. The required antiforgery header value "RequestVerificationToken" is not present. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery header value "RequestVerificationToken" is not present. at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)
The AI bot said something about adding this to the .HttpApi.Host project
//app.Use(async (ctx, next) =>
//{
// var accessToken = ctx.Request.Query["access_token"];
// if (!string.IsNullOrEmpty(accessToken) &&
// ctx.Request.Path.StartsWithSegments("/signalr-hubs/chat"))
// {
// ctx.Request.Headers["Authorization"] = "Bearer " + accessToken;
// }
// await next();
//});
But I'm using Blazor Server and thus not hosing the HttpApi.Host project. I don't support Bearer tokens at this point! Everything uses cookie auth I believe.
Ok I found the issue. It had to do with nuget.config. I had an empty nuget.config in that folder and seemingly either copying a correct one or deleting it solved the issue.
Ok I was missing a module dependency. All good now
It looks like adding this worked
[DependsOn(
typeof(AbpFeatureManagementBlazorServerModule)
)]
Still not sure why it was needed.
Ok now our custom feature group is not showing:
public class IseFeatureDefinitionProvider : FeatureDefinitionProvider
{
public override void Define(IFeatureDefinitionContext context)
{
var myGroup = context.AddGroup("ISE");
myGroup.AddFeature("ISE.IsPersonalEditingEnabled", defaultValue: "true",
displayName: LocalizableString.Create<IseCoreResource>("IsPersonalEditingEnabled"),
valueType: new ToggleStringValueType());
}
}
}
[brauerj@gc.adventist.org] said: It looks like I had some missing [DependesOn()] attributes for inter-modular dependencies. Adding those in to see if that helps.
It looks like the missing [DependsOn] attributes were the issue on my side. Adding these has seemingly solved the issue for both applications.
It looks like I had some missing [DependesOn()] attributes for inter-modular dependencies. Adding those in to see if that helps.