Base solution for your next web application

Activities of "enio"

I have created a custom module as described here: https://aspnetboilerplate.com/Pages/Documents/Module-System

The module is located in a separate project. Is there a solution to define also an AppService in this custom module so that the endpoint will be listed with swagger?

I have debugged that the application service is actually registered in the DI container. But it seems that neither swagger picks up the AppService nor does the endpoint at all is working (404 code).

Is there some documentation about this requirement somewhere?

Kind regards, Marco

Our aspnetzero version: 11.3.0

Since several days I am now struggling with getting windows authentication to work. The problem I currently have is that my user is not set in:

HttpContext.User.Identity?.Name

The User object is set, but it is empty.

As described here - I have registered the authentication scheme in startup.cs:

services.AddAuthentication(NegotiateDefaults.AuthenticationScheme).AddNegotiate();

But unfortunately the user on HttpContext remains empty. I am pretty sure that I have setup IIS correctly - because I have built a very simple demo asp.net 6.0 project which works just fine and loads the user provided with windows authentication.

Therefore I have to guess that somehow the authentication configuration that I provided is overwritten by aspnetzero. Could that be possible?

Product type: Angular Framework type: .net core ABP Framework version: v11

We do have an entity class defined as below:

[Table("Users", Schema = "Mstr")]
[Audited]
public class User
{
    public virtual string FamilyName { get; set; }

    public virtual string SurName { get; set; }

    [NotMapped]
    public virtual string DisplayName
    {
        get => SurName + " " + FamilyName;
        private set { }
    }
}

This is working just fine. Now we would like to extract the logic part SurName + " " + FamilyName to a helper class which is usually injected with dependency injection. Unfortunately DI is not working for an entity class.

Therefor my question: is there any way in aspnetzero to intercept the creation of new User objects? Is there a method from EF which I could override to execute some additional logic after a User object was created by EF?

We have succesfully integrated DevExpress Dashboard in our AspNetZero 6.7.0.0, .net core, angular 8 solution. This is a great feature and the dashboard/reporting is working perfectly.

However now we would like to secure the access to the dashboard therefore we wanted to check the users identity provided in the HttpContext. But unfortunately the identity is always empty/not set:

public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            //MVC
            services.AddMvc(options =>
            {
                options.Filters.Add(new CorsAuthorizationFilterFactory(DefaultCorsPolicyName));
            })
                .SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
                .AddDefaultDashboardController((configurator, serviceProvider) =>
                {
                    IHttpContextAccessor httpContextAccessor = (IHttpContextAccessor)serviceProvider.GetService(typeof(IHttpContextAccessor));
                    HttpContext context = httpContextAccessor.HttpContext;
                    var userIdentity = context.User.Identity;      <-- userIdentity.Name is null !!
                    ...

I guess the problem is that the Dashboards' Controller does now nothing about AspNetZero's authentication/authorization and therefore does not provide the information that I need. Is there a way that I can find out the current users Id?

In order to update an entity object including child object properties we have created a custom repository and are using the Update-Method directly on the EF-Context. But when we update the entities like this we don't have any entries in the AbpEntityPropertyChanges table. However we do have a new entry in AbpEntityChanges. Is there a simple way to fix this issue or is is meanwhile fixed - we are on version 6.7 from last february.

Do we have to implement IEntityHistoryStore in our custom repository - if yes could you please provide a simple example?

As stated in the this issue we do have the possibility to pass custom values to the initial GetAll by providing an implementation of ICustomConfigProvider. My question is how can I load some data from the database within such an implementation? Obviously DI is not working at this part of the application :-(

I have enabled LDAP authentication in code and afterwards on the settings page.

When I try to login with a non existing AD-User or take a wrong password I get the correct not authorized error message. However if I use an existing AD-username and correct password I get the following exception:

ERROR 2019-07-24 17:24:18,800 [82 ] Mvc.ExceptionHandling.AbpExceptionFilter - Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Abp.Authorization.Users.AbpUser1.SetNormalizedNames() at Abp.Authorization.AbpLogInManager3.TryLoginFromExternalAuthenticationSources(String userNameOrEmailAddress, String plainPassword, TTenant tenant) at Abp.Authorization.AbpLogInManager3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) at Abp.Authorization.AbpLogInManager3.LoginAsync(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task1 actualReturnValue, Func1 postAction, Action`1 finalAction) at web_manager.Web.Controllers.TokenAuthController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName) in /home/vsts/work/1/s/src/web_manager.Web.Core/Controllers/TokenAuthController.cs:line 590 at web_manager.Web.Controllers.TokenAuthController.Authenticate(AuthenticateModel model) in /home/vsts/work/1/s/src/web_manager.Web.Core/Controllers/TokenAuthController.cs:line 112 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()

Can you please point me the direction where I should search for a solution? As I get the exception message above only with correct login credentials I guess that ABP successfully communicated with the AD.

kind regards, marco

We are currently developing a distributed system with the help of nServiceBus. Now we would like to linke the back-backend-part of the system (which is processing the messages) with the entity framework part of asp.netzero. Therefore we referenced the asp.netzero Application project in our solution and make use of the Windsor DI container over the IocManager from Abp. However the entity framwork repositories are not registered in the container as we don't actually start the asp.netzero application.

Can you give us the direction where we should go?:

  • Is there a simple way to just register the entity framework repositories without starting the web.host project?
  • Or should we just copy the Web.Host project and start our back-backend-system within this context? Actually we would like to use as less as possible asp.netzero code in this part of our system.

Hi

I am using version 5.4.1 AspNetZeroAngular2 and would like to roll out the application on azure. Unfortunately the backend is not working once deployed to the azure app service. If I check out the log file I only see a lot of the following statements: Exception thrown: 'System.Data.SqlClient.SqlException' in System.Data.dll

...but not more information. Do you have an idea why there is no detailed information about the sql exception?

For a test I have started the backend localy and changed the password in the DB connection string to a non working value. And even in this case I can't see a clear information about the issue. So I guess that I miss some configuration option of the entityframework which filters out the details of the issue.

Showing 1 to 9 of 9 entries