Hi,
No I don't get any errors.
I can see the difference that ABP core modules use ApplicationLayout, but my component uses EmptyLayout.
Could you tell me what config to set the layout. As I know, we don't migrate or touch any configuration related to the layout.
That's my fault, I migrated to use provideAppInitializer for APP_ROUTE_PROVIDER provider, but did not fully migrate yet.
Here is the right one
export const APP_ROUTE_PROVIDER = [
provideAppInitializer(() => {
configureRoutes();
}),
];
function configureRoutes() {
const routes = inject(RoutesService);
routes.add([
...
]);
}
Hello,
Thank you, the version 9.2 fixed my problem, another issue comes in, why do I get the layout without side menu on our modules (e.g Home page).
If I route to http://localhost:4200/saas on the URL browser, then I will get the side menu.
Here is the registered providers & my home.component
Entry main
bootstrapApplication(AppComponent, {
providers: [
APP_ROUTE_PROVIDER,
CUSTOM_MENU_ITEM,
provideAnimations(),
provideZoneChangeDetection({ eventCoalescing: true }),
provideAbpCore(withOptions({ environment, registerLocaleFn: registerLocale() })),
provideAbpOAuth(),
provideAbpThemeShared(),
provideAccountAdminConfig(),
provideAccountPublicConfig(),
provideIdentityConfig(),
provideTenantManagementConfig(),
provideSaasConfig(),
provideSettingManagementConfig(),
provideOpeniddictproConfig(),
provideLanguageManagementConfig(),
provideChatConfig(),
provideGdprConfig(
withCookieConsentOptions({
privacyPolicyUrl: 'gdpr-cookie-consent/privacy',
cookiePolicyUrl: 'gdpr-cookie-consent/cookie',
})
),
provideFileManagementConfig(),
provideAuditLoggingConfig(),
provideTextTemplateManagementConfig(),
provideCommercialUiConfig(),
provideFeatureManagementConfig(),
provideRouter(routes),
importProvidersFrom(
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot(),
ProductServiceConfigModule.forRoot()
),
],
});
AppRoutes
// app.routes.ts
export const routes: Routes = [
{
path: 'home',
pathMatch: 'full',
loadChildren: () => import('./home/home.module').then(m => m.HomeModule),
canActivate: [authGuard, permissionGuard],
},
...
];
Home Module
// home.module.ts
@NgModule({
imports: [SharedModule, HomeRoutingModule, PageModule, HomeComponent],
})
export class HomeModule {}
// home-routing.module.ts
const routes: Routes = [{ path: '', component: HomeComponent, pathMatch: 'full', }];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class HomeRoutingModule {}
// home.component.ts
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
imports: [AnalysisModelComponent],
})
export class HomeComponent {
get hasLoggedIn(): boolean {
return this.oAuthService.hasValidAccessToken();
}
constructor(private oAuthService: OAuthService, private authService: AuthService) {}
login() {
this.authService.navigateToLogin();
}
}
// home.component.html
<h2>Home</h2>
<div class="card">
<div class="card-body">
<h2>My Work</h2>
<app-my-model [isShowOnHomePage]="true"></app-my-model>
</div>
</div>```
The generated answer by AI does not help. I need a person to support this one. Additionally, we're using ABP commercial packages.
Hi,
Thank your for your response.
Those issues did not provide helpful my case. However, I've used self-signed certificate with custom domain at my local machine. Therefore, I have to enable TLS for all services. Somehow it won't loop the request anymore.
Essentially, If not yet authorized, I can receive a response from AdministrationService/api/abp/application-configuration. However after authorized, It returns 500 error due to CORS issue.
From my understanding, if the header has Authorization entry, It needs to retrieve the configuration from /.well-known/openid-configuration of the AuthServer to validate the token. But the AdministrationService cannot reach to AuthServer via HTTPS.
Prior to this, It was successfully authorized with the AuthServer on SwaggerUI and obtained the access_token via HTTPS.
=> A part of log messages:
---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'https://authserver.mvm.local/.well-known/openid-configuration'. ---> System.Net.Http.HttpRequestException: Connection refused (authserver.mvm.local:443) ---> System.Net.Sockets.SocketException (111): Connection refused
Might be related to some previously posted issues.:
This is exception and stacktrace:
[16:29:18 INF] Request starting HTTP/1.1 GET http://administration.mvm.local/api/abp/application-configuration - -
[16:29:18 DBG] Wildcard detected, all requests with hosts will be allowed.
[16:29:18 VRB] All hosts are allowed.
[16:29:18 DBG] The request path /api/abp/application-configuration does not match a supported file type
[16:29:18 DBG] 1 candidate(s) found for the request path '/api/abp/application-configuration'
[16:29:18 DBG] Endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)' with route pattern 'api/abp/application-configuration' is valid for the request path '/api/abp/application-configuration'
[16:29:18 DBG] Request matched endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
[16:29:18 ERR] Exception occurred while processing message.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://authserver.mvm.local/.well-known/openid-configuration'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'https://authserver.mvm.local/.well-known/openid-configuration'.
---> System.Net.Http.HttpRequestException: Connection refused (authserver.mvm.local:443)
---> System.Net.Sockets.SocketException (111): Connection refused
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)