Atividades de "jpatron"

  • ABP Framework version: v6.0.3
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: N/A
  • Steps to reproduce the issue: N/A

Hello,

I am in the process of integrating Azure AD B2C with one of our applications using ABP Commercial framework. Azure AD B2C users are able to login to our application successfully after signing up for an account, and I noticed that ABP treats them as external users and I could not find any trace of stored information in our application database when it comes to the user and its roles, permissions, etc. So my question is, how do we assign roles and permissions to users that only exist in Azure AD B2C?

Thanks!

Pergunta
  • ABP Framework version: v6.0.3

  • UI Type: MVC

  • Database System: EF Core (SQL Server)

  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

  • Exception message and full stack trace: [xUnit.net 00:00:16.32] Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module MyApp.MyAppTestBaseModule, MyApp.TestBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: The property 'Provstate.Id' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal.. See the inner exception for details. [xUnit.net 00:00:16.32] ---- System.InvalidOperationException : The property 'Provstate.Id' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal. [xUnit.net 00:00:16.32] Stack Trace: [xUnit.net 00:00:16.32] at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) [xUnit.net 00:00:16.32] at Volo.Abp.AbpApplicationBase.InitializeModules() [xUnit.net 00:00:16.32] at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplication(IApplicationBuilder app) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\test\MyApp.Web.Tests\MyAppWebTestStartup.cs(16,0): at MyApp.MyAppWebTestStartup.Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) [xUnit.net 00:00:16.32] at System.RuntimeMethodHandle.InvokeMethod(Object target, Span1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) [xUnit.net 00:00:16.32] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) [xUnit.net 00:00:16.32] at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) [xUnit.net 00:00:16.32] at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Start(IHost host) [xUnit.net 00:00:16.32] at Volo.Abp.AspNetCore.TestBase.AbpAspNetCoreIntegratedTestBase1..ctor() [xUnit.net 00:00:16.32] at MyApp.MyAppWebTestBase..ctor() [xUnit.net 00:00:16.32] at MyApp.Pages.Questionnaire_Tests..ctor() [xUnit.net 00:00:16.32] at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) [xUnit.net 00:00:16.32] ----- Inner Stack Trace ----- [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetPropertyModified(IProperty property, Boolean changeState, Boolean isModified, Boolean isConceptualNull, Boolean acceptChanges) [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectValueChange(InternalEntityEntry entry, IProperty property) [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.LocalDetectChanges(InternalEntityEntry entry) [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectChanges(IStateManager stateManager) [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.DetectChanges() [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.TryDetectChanges() [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.Entries() [xUnit.net 00:00:16.32] at Volo.Abp.EntityFrameworkCore.AbpDbContext1.HandlePropertiesBeforeSave() [xUnit.net 00:00:16.32] at Volo.Abp.EntityFrameworkCore.AbpDbContext1.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) [xUnit.net 00:00:16.32] at Volo.Abp.Uow.UnitOfWork.SaveChangesAsync(CancellationToken cancellationToken) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\src\MyApp.Domain\Seed\MyAppDataSeedContributor.cs(117,0): at MyApp.Seed.MyAppDataSeedContributor.SeedFormTypes() [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\src\MyApp.Domain\Seed\MyAppDataSeedContributor.cs(59,0): at MyApp.Seed.MyAppDataSeedContributor.SeedAsync(DataSeedContext context) [xUnit.net 00:00:16.32] at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context) [xUnit.net 00:00:16.32] at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) [xUnit.net 00:00:16.32] at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync() [xUnit.net 00:00:16.32] at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) [xUnit.net 00:00:16.32] at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\test\MyApp.TestBase\MyAppTestBaseModule.cs(40,0): at MyApp.MyAppTestBaseModule.<>c__DisplayClass2_0.<<SeedTestData>b__0>d.MoveNext() [xUnit.net 00:00:16.32] --- End of stack trace from previous location --- [xUnit.net 00:00:16.32] at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) [xUnit.net 00:00:16.32] at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t) [xUnit.net 00:00:16.32] at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() [xUnit.net 00:00:16.32] at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj) [xUnit.net 00:00:16.32] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [xUnit.net 00:00:16.32] --- End of stack trace from previous location --- [xUnit.net 00:00:16.32] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [xUnit.net 00:00:16.32] at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) [xUnit.net 00:00:16.32] --- End of stack trace from previous location --- [xUnit.net 00:00:16.32] at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) [xUnit.net 00:00:16.32] at Nito.AsyncEx.AsyncContext.Run(Func1 action) [xUnit.net 00:00:16.32] at Volo.Abp.Threading.AsyncHelper.RunSync(Func1 action) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\test\MyApp.TestBase\MyAppTestBaseModule.cs(37,0): at MyApp.MyAppTestBaseModule.SeedTestData(ApplicationInitializationContext context) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\test\MyApp.TestBase\MyAppTestBaseModule.cs(32,0): at MyApp.MyAppTestBaseModule.OnApplicationInitialization(ApplicationInitializationContext context) [xUnit.net 00:00:16.32] at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) [xUnit.net 00:00:16.32] at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)

  • Steps to reproduce the issue:

    1. Run all tests

We have an issue where random unit tests fail randomly but the error message is consistent (see stack trace above). I did some research and you may have solved a similar issue in newer versions of ABP: https://support.abp.io/QA/Questions/5204/Randomly-test-are-failing

My question is whether I can implement that solution in v.6.0.3. If so, can you provide some guidance on how to do such implementation? Thanks!

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

Hello,

I created a setting to determine whether the tenant should use a specific connection string to a database with real data or another connection string that points to a "demo" database. I followed the idea of overwriting the connection string by calling a method under ConfigureServices in our web application module as suggested by the following link: https://docs.abp.io/en/abp/6.0/Connection-Strings However, if I try to get the ISettingsManager at that point, it is always null. I have also tried getting IServiceProvider and ServiceProvider with the same unsuccessful results. Here is the method I am using to accomplish this task:

private async Task ConfigureDemo(ServiceConfigurationContext context, IConfiguration configuration)
    {
        var settingProvider = context.Services.GetObjectOrNull<ISettingManager>();
        if (settingProvider != null)
        {
            var useDemoDb = await settingProvider.GetOrNullForCurrentTenantAsync(<Our_App>Settings.UseDemo);
            if (useDemoDb.Equals("True", StringComparison.OrdinalIgnoreCase))
            {
                Configure<AbpDbConnectionOptions>(options =>
                {
                    options.ConnectionStrings["RealDataDb"] = configuration.GetConnectionString("DemoDb");
                });
            }
        }
    }

Do you have any ideas or suggestions on how we can solve this problem? Thanks in advance!

Mostrando 1 até 3 de 3 registros
Made with ❤️ on ABP v8.2.0-preview Updated on março 25, 2024, 15:11