Activities of "falsharif"

Question

ABP Framework version: v4.2.2 UI type: Blazor DB provider: EF Core / Tiered (MVC) or Identity Server Separated (Angular): no

Hi Team, i currently have multitenant database per tenant implementation for one of my projects. The scenario is as follows:

Its a supermarket management SaaS, i have one host database and around 400 Databases for the tenants. 1 database per supermarket.

Now i am currently creating a customer mobile app in which the customers can order from the supermarkets. So the user registers and that creates a user in the host database, the user logs into the app then chooses a supermarket to place the order . When the user creates an order, this will create a new order in the relavant database. However, some tables have audited entities, how will the userId be carried over to the tenant database ? do i have to create the user again in the relevant database or how do i navigate such a situation ?

I hope you understand the situation, let me know if you have any questions .

Thank you for the soluition

  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core /
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hi team, I wanted to ask you about a couple things. I have a blazor app running using the abp template. I am using the default authentication using the OPENID .

what is the advantage of using OPENID vs regular JWT token and attaching to the header ?

how can i change the behaviour of logging out --> going to a page that says i will be redirected ---> going to a page that says "Logged out" ??

at the moment, the redirect after i log out takes me to https://app.promailnet.com/authentication/logged-out , but i want it to go back to the login screen.

is there a way to user regular JWT ?

  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core /
  • Tiered (MVC) or Identity Server Separated (Angular): / no

Hi Team, I want to automatically generate a connectionstring when a new tenant is created , however since i dont have the source code for tenantappserivce, how can i override it ? or what is the solution in my case ?

Cheers, Fathi CTO

This is not what i am looking for. I tried this and it works when its one to one, but as you can see my relationship is one to many :

1 user has many InventoryAdjustmentLogs.

Can you please show me an example that covers this scenario ?

Hi team, Iam Trying to create a navigation property for Appuser from my entity so i can include the name of the creator in the front end : i read the documentation and it said something about maping it or ignoring it , but i dont understand what to do exactly

My entity :

{ public class InventoryAdjustmentLog : AuditedEntityWithUser<Guid,AppUser> {

    public InventoryAdjustmentLog()
    {
        
      
    }

  
   public int CurrentStockLevel { get; set; }

   public int AdjustedStockLevel { get; set; }

   public Guid? ReasonId { get; set; }

   public virtual Reason Reason { get; set; }

    public Guid ProductId { get; set; }

   public virtual Product Product { get; set; }


 

}

}

How can i implement this without getting this error :

---- System.InvalidOperationException : The property 'AppUser.ExtraProperties' could not be mapped, because it is of type 'Dictionary&lt;string, object&gt;' which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

Message: Volo.Abp.AbpInitializationException : An error occurred during ConfigureServices phase of the module Dukkantek.EntityFrameworkCore.DukkantekEntityFrameworkCoreTestModule, Dukkantek.EntityFrameworkCore.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details. ---- System.InvalidOperationException : The property 'AppUser.ExtraProperties' could not be mapped, because it is of type 'Dictionary<string, object>' which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. Stack Trace: AbpApplicationBase.ConfigureServices() AbpApplicationBase.ctor(Type startupModuleType, IServiceCollection services, Action1 optionsAction) AbpApplicationWithExternalServiceProvider.ctor(Type startupModuleType, IServiceCollection services, Action1 optionsAction) AbpApplicationFactory.Create(Type startupModuleType, IServiceCollection services, Action1 optionsAction) AbpApplicationFactory.Create[TStartupModule](IServiceCollection services, Action1 optionsAction) ServiceCollectionApplicationExtensions.AddApplication[TStartupModule](IServiceCollection services, Action1 optionsAction) AbpIntegratedTest1.ctor() DukkantekTestBase1.ctor() DukkantekApplicationTestBase.ctor() InventoryAppServiceTests.ctor(ITestOutputHelper Output) line 23 ----- Inner Stack Trace ----- ModelValidator.ValidatePropertyMapping(IModel model, IDiagnosticsLogger1 logger) ModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) RelationalModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) SqliteModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) ValidatingConvention.ProcessModelFinalized(IConventionModelBuilder modelBuilder, IConventionContext1 context) ImmediateConventionScope.OnModelFinalized(IConventionModelBuilder modelBuilder) ConventionDispatcher.OnModelFinalized(IConventionModelBuilder modelBuilder) Model.FinalizeModel() ModelBuilder.FinalizeModel() ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder) ModelSource.GetModel(DbContext context, IConventionSetBuilder conventionSetBuilder) DbContextServices.CreateModel() DbContextServices.get_Model() <>c.<TryAddCoreServices>b__7_3(IServiceProvider p) CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context) CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) <>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope) ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) ServiceProviderEngineScope.GetService(Type serviceType) ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) DbContext.get_DbContextDependencies() DbContext.get_InternalServiceProvider() IServiceProvider>.get_Instance() InfrastructureExtensions.GetService[TService](IInfrastructure1 accessor) AccessorExtensions.GetService[TService](IInfrastructure1 accessor) DukkantekEntityFrameworkCoreTestModule.CreateDatabaseAndGetConnection() line 56 DukkantekEntityFrameworkCoreTestModule.ConfigureInMemorySqlite(IServiceCollection services) line 29 DukkantekEntityFrameworkCoreTestModule.ConfigureServices(ServiceConfigurationContext context) line 25 AbpApplicationBase.ConfigureServices()

  • ABP Framework version: v3.1.2
  • UI type: Angular
  • Tiered (MVC) or Identity Server Seperated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

HI team, I purchased ABP Commercial and to be honest so far, every step of the way i had an issue. The current issue i am stuck on is when i try to login as a tenant.

So far : i created few Tenants :

then i ran Dbmigrator Project :

successfull

Databases Created :

All good.

try and login as the new Tenant :

Cant login : i get this Invalid Grant error no matter what i do.

Perfect :) What a legend, thanks alot for your support !

Hi team, First of all thanks alot of the amazing work with the ABP Commercial.

I am currently having an issue that seems obvious but i might be doing something wrong, would really appreciate your help as i am stuck.

So when i am trying to run my initial Db migration, i am getting this error :

System.InvalidOperationException: 'The property 'AppUser.ExtraProperties' could not be mapped, because it is of type 'Dictionary<string, object>' which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.'

I followed the guide to extend AppUser Entity :

My AppUser Entity :

namespace Dukkantek.Users {

public class AppUser : FullAuditedAggregateRoot&lt;Guid&gt;, IUser
{
    #region Base properties

    /* These properties are shared with the IdentityUser entity of the Identity module.
     * Do not change these properties through this class. Instead, use Identity module
     * services (like IdentityUserManager) to change them.
     * So, this properties are designed as read only!
     */

    public virtual Guid? TenantId { get; private set; }

    public virtual string UserName { get; private set; }

    public virtual string Name { get; private set; }

    public virtual string Surname { get; private set; }

    public virtual string Email { get; private set; }

    public virtual bool EmailConfirmed { get; private set; }

    public virtual string PhoneNumber { get; private set; }

    public virtual bool PhoneNumberConfirmed { get; private set; }

    #endregion

    

    /* Add your own properties here. Example:
     *
     * public virtual string MyProperty { get; set; }
     * public string MyProperty { get; set; }
     *
     * If you add a property and using the EF Core, remember these;
     *
     * 1. update DukkantekDbContext.OnModelCreating
     * to configure the mapping for your new property
     * 2. Update DukkantekEfCoreEntityExtensionMappings to extend the IdentityUser entity
     * and add your new property to the migration.
     * 3. Use the Add-Migration to add a new database migration.
     * 4. Run the .DbMigrator project (or use the Update-Database command) to apply
     * schema change to the database.
     */


    
    public virtual ICollection&lt;Customer&gt; Customers { get; set; }
    private AppUser()
    {
        
    }
}

Now my AppUser has a one to many relationship with Customer -- > ** public virtual ICollection<Customer> Customers { get; set; } **

** and in my Customer Class:**

public class Customer : AuditedAggregateRoot&lt;Guid&gt;, ISoftDelete
{
 
    [Required]
    [StringLength(50)]
    public string Name { get; set; }

    [StringLength(15)]
    public string Phone { get; set; }

 public Guid UserId { get; set; }
 public virtual AppUser User { get; set; }






My DbContexts OnModelCreating  :  

protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder);

        /* Configure the shared tables (with included modules) here */

        builder.Entity&lt;AppUser&gt;(b =>
        {
            b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "Users"); //Sharing the same table "AbpUsers" with the IdentityUser
            b.HasMany(p => p.Customers).WithOne().HasForeignKey(r => r.UserId);
         
            b.ConfigureExtraProperties();
            b.ConfigureByConvention();
            b.ConfigureAbpUser();
          
            /* Configure mappings for your additional properties.
             * Also see the DukkantekEfCoreEntityExtensionMappings class.
             */
        });
        
        

** DukkantekDbContextModelCreatingExtensions**

        builder.Entity&lt;Customer&gt;(b =>
        {
            b.ToTable(DukkantekConsts.DbTablePrefix + "Customers", DukkantekConsts.DbSchema);
            b.ConfigureByConvention(); //auto configure for the base class props

        });
        
        

** DukkantekEfCoreEntityExtensionMappings** public static void Configure() { DukkantekGlobalFeatureConfigurator.Configure(); DukkantekModuleExtensionConfigurator.Configure();

        OneTimeRunner.Run(() =>
        {
          
             * See the documentation for more:
             * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
             */
       
            ObjectExtensionManager.Instance.MapEfCoreProperty&lt;IdentityUser, ICollection&lt;Customer&gt;>("Customers");
         
         
        });
    }

I feel like this line is probably the issue : ObjectExtensionManager.Instance.MapEfCoreProperty<IdentityUser, ICollection<Customer>>("Customers");

so how do i map IdentityUser to an ICollection of Customers ?? would really appreciate your support on this

Hey liangshiwei, Thank you so much for your quick response. you've directed my in the right path.

so i inspected the angular UI that comes with ABP.io Commercial

initially it calls this end point :

https://localhost:44315/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fresponse_type%3Dcode%26client_id%3DDukkantek_App%26state%3DT1ZzWURVM3Nuc3NBSGE5T2JHUWV5WnhRSXpEbFVMS21GU2lnNC5SbmZ1S2Rp%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A4200%26scope%3Dopenid%2520offline_access%2520Dukkantek%26code_challenge%3DJfVGbkk5sp5b0vrtOjtzNlcz5THP_qOom3FSe10_MUU%26code_challenge_method%3DS256%26nonce%3DT1ZzWURVM3Nuc3NBSGE5T2JHUWV5WnhRSXpEbFVMS21GU2lnNC5SbmZ1S2Rp

**then it calls this after a redirect : **

Request URL: https://localhost:44315/connect/token Request Method: POST Status Code: 200 Remote Address: [::1]:44315 Referrer Policy: strict-origin-when-cross-origin access-control-allow-credentials: true access-control-allow-origin: http://localhost:4200 access-control-expose-headers: _AbpErrorFormat cache-control: no-store, no-cache, max-age=0 content-type: application/json; charset=UTF-8 date: Sat, 26 Sep 2020 06:15:47 GMT pragma: no-cache server: Microsoft-IIS/10.0 status: 200 vary: Origin x-powered-by: ASP.NET :authority: localhost:44315 :method: POST :path: /connect/token :scheme: https accept: application/json, text/plain, / accept-encoding: gzip, deflate, br accept-language: en cache-control: no-cache content-length: 212 content-type: application/x-www-form-urlencoded origin: http://localhost:4200 pragma: no-cache referer: http://localhost:4200/ sec-fetch-dest: empty sec-fetch-mode: cors sec-fetch-site: cross-site user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36

grant_type: authorization_code code: O416BxbQi5vr7uAb0bTE6xMkoB7jeWn_wq8JdmWNzGA redirect_uri: http://localhost:4200 code_verifier: WFp4c2F5MDFJaS51MUxQNzhzTXBJV1B3V3VFUjMuVnpMcDVvTnlTd2phUk52 client_id: Dukkantek_App

I am authenticating from a mobile app , so what is the flow exactly , how do i directly send a username , password, tenantid and get back a JWT token ?

Showing 21 to 30 of 31 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11