Activities of "imranStem"

Question

I am following https://docs.abp.io/en/abp/latest/UI/Angular/Component-Replacement document to replace the route's component and create custom routes as per our requirements. But as per the documents, the html is binding only two routes of the administration menu. I want to bind the custom routes as per the route providers that I have configured and the route providers of administration and SaaS menu based on permission.

I am also getting the following error in routes.component.html.

Also, I noticed that the administration menu is not expanding and CSS is not proper.

I want the custom routes the same as the in-built route's component so I can customize a little bit on component html.

  • ABP Framework version: v5.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I have microservice architecture and I have integrated the NgxsRouterPluginModule in Angular project and injected into app.module.ts. To reproduce the issue, you can follow below changes.

Install the NgxsRouterPluginModule

"@ngxs/router-plugin": "^3.7.4",

Change the environment configuration to use the account module login UI.

const oAuthConfig = { issuer: 'https://localhost:44322', clientId: 'App_Angular', scope: 'offline_access openid profile email phone', requireHttps: true, };

Inject the NgxsRouterPluginModule in app.module.ts

..... NgxsRouterPluginModule.forRoot(), NgxsLoggerPluginModule.forRoot(), NgxsReduxDevtoolsPluginModule.forRoot(), ],

With the above configuration, the login page won't work and you will get the below error in the console.

vendor.js:69956 ERROR TypeError: Cannot read properties of undefined (reading 'isEnabled') at get isEnabled [as isEnabled] (node_modules_volo_abp_ng_account_fesm2015_volo-abp_ng_account-public_mjs.js:5560:30) at vendor.js:9296:14 at Array.forEach (<anonymous>) at deepFreeze (vendor.js:9289:35) at vendor.js:9299:13 at Array.forEach (<anonymous>) at deepFreeze (vendor.js:9289:35) at vendor.js:9299:13 at Array.forEach (<anonymous>) at deepFreeze (vendor.js:9289:35)

Login screen looks like this.

  • ABP Framework version: v5.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: vendor.js:69956 ERROR TypeError: Cannot read properties of undefined (reading 'isEnabled') at get isEnabled [as isEnabled] (node_modules_volo_abp_ng_account_fesm2015_volo-abp_ng_account-public_mjs.js:5560:30) at vendor.js:9296:14 at Array.forEach (<anonymous>) at deepFreeze (vendor.js:9289:35) at vendor.js:9299:13 at Array.forEach (<anonymous>) at deepFreeze (vendor.js:9289:35) at vendor.js:9299:13 at Array.forEach (<anonymous>) at deepFreeze (vendor.js:9289:35)
  • Steps to reproduce the issue:"

I want to create the custom definition provider as per our project requirement. I have a microservice architecture and I have one module to register the services from different microservices. I have checked the SettingDefinitionProvider, and PermissionDefinitionProvider, the same way, I want to create the ServiceDefinationProvider with the group name and key value so I can register the definitions in all microservices and can use the Key to identify the registered service. Is there any way to create the custom definition provider and get all the definitions through the api-definitions endpoint?

  • ABP Framework version: v5.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

The issue is fixed.

I have configured new microservices and deployed them on Kubernetes. I am getting the following error. It's working fine in local.

Logs

[11:48:57 INF] Request starting HTTP/1.1 GET http://product-service-v1.mydomain.com/ - - [11:48:57 ERR] Connection id "0HMI4HCOL9UUN", Request id "0HMI4HCOL9UUN:00000003": An unhandled exception was thrown by the application. System.InvalidOperationException: Unable to resolve service for type 'Swashbuckle.AspNetCore.Swagger.ISwaggerProvider' while attempting to Invoke middleware 'Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware'. at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.GetService(IServiceProvider sp, Type type, Type middleware) at lambda_method880(Closure , Object , HttpContext , IServiceProvider ) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<UseMiddleware>b__2(HttpContext context) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.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.Security.Claims.AbpClaimsMapMiddleware.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.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) [11:48:57 INF] Request finished HTTP/1.1 GET http://product-service-v1.mydomain.com/ - - - 500 0 - 2.9439ms

  • ABP Framework version: v5.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

When I restore the projects, I am getting the following error.

Build started... Retrying 'FindPackagesByIdAsync' for source 'https://nuget.abp.io/{key}/v3/package/microsoft.extensions.fileproviders.embedded/index.json'. Response status code does not indicate success: 500 (Internal Server Error). Retrying 'FindPackagesByIdAsync' for source 'https://nuget.abp.io/{key}/v3/package/microsoft.extensions.fileproviders.embedded/index.json'. Response status code does not indicate success: 500 (Internal Server Error). NuGet package restore failed. Please see Error List window for detailed warnings and errors. Error occurred while restoring NuGet packages: Failed to retrieve information about 'Microsoft.Extensions.FileProviders.Embedded' from remote source 'https://nuget.abp.io/{key}/v3/package/microsoft.extensions.fileproviders.embedded/index.json'.

  • ABP Framework version: v4.3.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

The above issue is fixed. Thanks for your support.

Ok, The issuer issue is fixed. Now getting below error in auth server logs.

[09:37:16 INF] CORS policy execution successful. [09:37:16 INF] Invoking IdentityServer endpoint: IdentityServer4.Endpoints.TokenEndpoint for /connect/token [09:37:16 INF] {"ClientId": "ChurchPharmacy_Angular", "AuthenticationMethod": "NoSecret", "Category": "Authentication", "Name": "Client Authentication Success", "EventType": "Success", "Id": 1010, "Message": null, "ActivityId": "0HMHUVCU8Q8EE:00000005", "TimeStamp": "2022-05-26T09:37:16.0000000Z", "ProcessId": 1, "LocalIpAddress": "::ffff:10.244.0.167:80", "RemoteIpAddress": "27.109.16.210", "$type": "ClientAuthenticationSuccessEvent"} [09:37:16 ERR] Client not authorized for resource owner flow, check the AllowedGrantTypes setting{"client_id": "ChurchPharmacy_Angular"}, details: {"ClientId": "ChurchPharmacy_Angular", "ClientName": "ChurchPharmacy_Angular", "GrantType": "password", "Scopes": null, "AuthorizationCode": "", "RefreshToken": "", "UserName": null, "AuthenticationContextReferenceClasses": null, "Tenant": null, "IdP": null, "Raw": {"grant_type": "password", "scope": "offline_access openid profile email phone AccountService IdentityService AdministrationService SaasService ProductService", "client_id": "ChurchPharmacy_Angular", "username": "admin", "password": "REDACTED"}, "$type": "TokenRequestValidationLog"} [09:37:16 INF] {"ClientId": "ChurchPharmacy_Angular", "ClientName": "ChurchPharmacy_Angular", "RedirectUri": null, "Endpoint": "Token", "SubjectId": null, "Scopes": null, "GrantType": "password", "Error": "unauthorized_client", "ErrorDescription": null, "Category": "Token", "Name": "Token Issued Failure", "EventType": "Failure", "Id": 2001, "Message": null, "ActivityId": "0HMHUVCU8Q8EE:00000005", "TimeStamp": "2022-05-26T09:37:16.0000000Z", "ProcessId": 1, "LocalIpAddress": "::ffff:10.244.0.167:80", "RemoteIpAddress": "27.109.16.210", "$type": "TokenIssuedFailureEvent"} [09:37:16 INF] Request finished HTTP/1.1 POST http://auth-server-v1.mydomain.com/connect/token application/x-www-form-urlencoded 230 - 400 - application/json;+charset=UTF-8 41.5066ms

I have the below configuration in angular.

const oAuthConfig = {
  issuer: 'https://auth-server-v1.mydomain.com',
  clientId: 'ChurchPharmacy_Angular',
  scope:
    'offline_access openid profile email phone AccountService IdentityService AdministrationService SaasService ProductService'
};

All the configurations are done. Now when I try to log in with auth server, the login successfully done but it's not authenticated on the angular website.

administration log

[07:08:41 INF] Request starting HTTP/1.1 GET http://my-company-administration-service-v1.company-staging.svc.cluster.local/api/abp/application-configuration - 0 [07:08:41 INF] CORS policy execution successful. [07:08:41 INF] CORS policy execution successful. [07:08:41 INF] Failed to validate the token. Microsoft.IdentityModel.Tokens.SecurityTokenInvalidIssuerException: IDX10205: Issuer validation failed. Issuer: 'https://auth-server-v1.mydomain.com'. Did not match: validationParameters.ValidIssuer: 'null' or validationParameters.ValidIssuers: 'http://auth-server-v1.mydomain.com'. at Microsoft.IdentityModel.Tokens.Validators.ValidateIssuer(String issuer, SecurityToken securityToken, TokenValidationParameters validationParameters) at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateIssuer(String issuer, JwtSecurityToken jwtToken, TokenValidationParameters validationParameters) at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateTokenPayload(JwtSecurityToken jwtToken, TokenValidationParameters validationParameters) at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken(String token, TokenValidationParameters validationParameters, SecurityToken& validatedToken) at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync() [07:08:41 INF] Bearer was not authenticated. Failure message: IDX10205: Issuer validation failed. Issuer: 'https://auth-server-v1.mydomain.com'. Did not match: validationParameters.ValidIssuer: 'null' or validationParameters.ValidIssuers: 'http://auth-server-v1.mydomain.com'. [07:08:41 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)' [07:08:41 INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync() on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc). [07:08:41 WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'. [07:08:41 INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'. [07:08:41 INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 108.1989ms [07:08:41 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)' [07:08:41 INF] Request finished HTTP/1.1 GET http://company-staging-administration-service-v1.company-staging.svc.cluster.local/api/abp/application-configuration - 0 - 200

I have changed the ocelot values in config map with the service's endpoint address and the above issue is fixed but is this the correct configuration to use the service endpoint instead of the domain URL in the production?

Showing 21 to 30 of 73 entries
Made with ❤️ on ABP v9.1.0-rc.1. Updated on January 17, 2025, 14:13