Activities of "yilmaz.132"

Yes, adding the module fixed it, but why am I adding the Identity EFCore module? Because there was no need to add this in other similar projects.

Identity is another project and I manage it in database.

  • ABP Framework version: v4.4.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
[ERR] An exception was thrown while activating Odin.Countries.CountryController -> Odin.Countries.CountryAppService -> Odin.Users.AppUserLookupService -> Volo.Abp.Identity.IdentityUserRepositoryExternalUserLookupServiceProvider.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Odin.Countries.CountryController -> Odin.Countries.CountryAppService -> Odin.Users.AppUserLookupService -> Volo.Abp.Identity.IdentityUserRepositoryExternalUserLookupServiceProvider.
 ---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Volo.Abp.Autofac.AbpAutofacConstructorFinder' on type 'Volo.Abp.Identity.IdentityUserRepositoryExternalUserLookupServiceProvider' can be invoked with the available services and parameters:
Cannot resolve parameter 'Volo.Abp.Identity.IIdentityUserRepository userRepository' of constructor 'Void .ctor(Volo.Abp.Identity.IIdentityUserRepository, Microsoft.AspNetCore.Identity.ILookupNormalizer)'.
   at Autofac.Core.Activators.Reflection.ReflectionActivator.GetAllBindings(ConstructorBinder[] availableConstructors, IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Activators.Reflection.ReflectionActivator.<ConfigurePipeline>b__11_0(ResolveRequestContext ctxt, Action`1 next)
   at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   at Autofac.Builder.RegistrationBuilder`3.&lt;&gt;c__DisplayClass41_0.&lt;PropertiesAutowired&gt;b__0(ResolveRequestContext ctxt, Action`1 next)
   at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request)
   at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request)
   at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2021-10-18 13:48:37.281 +03:00 [ERR] ---------- Exception Data ----------
ActivatorChain = Odin.Countries.CountryController -> Odin.Countries.CountryAppService -> Odin.Users.AppUserLookupService -> Volo.Abp.Identity.IdentityUserRepositoryExternalUserLookupServiceProvider
  • Steps to reproduce the issue:"

Hello Team,

I am getting depend error in AppUserLookupService class.I did it based on the sample projects, but I could not solve the error.

 public interface IAppUserLookupService : IUserLookupService<AppUser>
    {
    }
public class AppUserLookupService : UserLookupService<AppUser, IAppUserRepository>, IAppUserLookupService
    {
        public AppUserLookupService(
            IAppUserRepository userRepository,
            IUnitOfWorkManager unitOfWorkManager)
            : base(
                  userRepository,
                  unitOfWorkManager
                  )
        {

        }

        protected override AppUser CreateUser(IUserData externalUser)
        {
            return new AppUser(externalUser);
        }
    }
 public interface IAppUserRepository : IBasicRepository<AppUser, Guid>, IUserRepository<AppUser>
{
    Task<List<AppUser>> GetUsersAsync(int maxCount, string filter, CancellationToken cancellationToken = default);
}
public class EfCoreAppUserRepository : EfCoreUserRepositoryBase<OdinDbContext, AppUser>, IAppUserRepository
    {
        public EfCoreAppUserRepository(IDbContextProvider<OdinDbContext> dbContextProvider)
           : base(dbContextProvider)
        {

        }

        public async Task<List<AppUser>> GetUsersAsync(int maxCount, string filter, CancellationToken cancellationToken = default)
        {
            return await (await GetDbSetAsync())
                .WhereIf(!string.IsNullOrWhiteSpace(filter), x => x.UserName.Contains(filter))
                .Take(maxCount).ToListAsync(cancellationToken);
        }
    }
}
public class AppUser : AggregateRoot<Guid>, IUser, IUpdateUserData
    {
        #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 ArtFlowDbContext.OnModelCreating
         * to configure the mapping for your new property
         * 2. Update ArtFlowEfCoreEntityExtensionMappings 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.
         */

        protected AppUser()
        {

        }

        public AppUser(IUserData user)
         : base(user.Id)
        {
            TenantId = user.TenantId;
            UpdateInternal(user);
        }

I added AbpHttpClientIdentityModelModule and AbpIdentityHttpApiClientModule modules.

 [DependsOn(
        typeof(OdinHttpApiModule),
        typeof(OdinApplicationModule),
        typeof(OdinEntityFrameworkCoreModule),
        typeof(OdinCouchbaseModule),
        typeof(AbpPermissionManagementDomainIdentityModule),
        typeof(RetinaPermissionManagementDomainCcmsModule),
        typeof(AbpAutofacModule),
        typeof(AbpEventBusRabbitMqModule),
        typeof(AbpBackgroundJobsRabbitMqModule),
        typeof(AbpAspNetCoreMultiTenancyModule),
        typeof(AbpCachingStackExchangeRedisModule),
        typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
        typeof(AbpIdentityAspNetCoreModule),
        typeof(AbpSwashbuckleModule),
        typeof(AbpAspNetCoreSerilogModule),
        typeof(AbpHttpClientIdentityModelModule),
        typeof(AbpIdentityHttpApiClientModule),
        typeof(AbpPermissionManagementEntityFrameworkCoreModule),
        typeof(SaasEntityFrameworkCoreModule)
        )]
    public class OdinHttpApiHostModule : AbpModule
"IdentityClients": {
    "Default": {
      "GrantType": "client_credentials",
      "ClientId": "OdinService",
      "ClientSecret": "1q2w3e*",
      "Authority": "https://localhost:44322",
      "Scope": "IdentityService"
    }
  },

I added AbpUsersEntityFrameworkCoreModule to EFCore module and I added AbpUsersDomainModule to DomainModule module.

Thank you for support.

Actually no.

I want IssuerUri to be constant on IdentityServer side. It shouldn't change by domain. Micro-services cannot validate IssuerUri when IssuerUri varies by domain. For this, I close as follows, but I do not want it.

options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters { ValidateIssuer = false };

I add the following to fix IssuerUri in IdentityServer section. But it's not working. Configure<IdentityServerOptions>(options => { options.IssuerUri = "mydomain.app"; });

Hi,

AuthServerModule: Configure<AbpTenantResolveOptions>(options => { options.AddDomainTenantResolver(configuration["App:TenantDomainFormat"]); //{0}.mydomain.com }); Configure<IdentityServerOptions>(options => { options.IssuerUri = configuration["App:SelfUrl"]; //mydomain.com });

I define the IssuerUri as mydomain.com. However, when logged in as turkey.mydomain.com, the issuer changes to turkey.mydomain.com in the .well-known/openid-configuration information.

My problem is on the IdentityServer App (AuthServer) side.

It is already defined in the web client application as you have forwarded in the link.

ABP Framework version: v4.3.1 DB provider: SQL Server Tiered (MVC) or Identity Server Separated : yes Exception message and stack trace:

I am giving fixed IssuerUri address in IdentityServer application module. Configure<IdentityServerOptions>(options => { options.IssuerUri = configuration["App:SelfUrl"]; });

IdentityServer and my other applications revolve Tenant via sub-domain.

However, although I have given the Identity Server Issuer Uri as a constant, it varies according to the domain.

How can i solve this problem. Application sample link I referenced: https://github.com/abpframework/abp-samples/tree/master/DomainTenantResolver/MVC-TIERED

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