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?

Answer

Hi epicadmin,

have you been successful in setting up windows authentication? Unfortunately it seems that aspnetzero indeed ignores this important business scenario. I haven't found any useful documentation about that.

If you were successful I would be very happy if you could write down some words about what you have done.

Kind regards, marco

Hi ismagdas

I see that there is currently no matching hook/event available in entity framework or abp. It seems a bit strange to me that apparently there is no need for that.

kind regards, marco

Hi @ismcagdas

Thank you for your hint with the computed column. I already checked out this approach but unfortunately this does not work with Dependency Injection.

Kind regards, marco

Hi @musa.demir

Thank you for your hint with the entity-changes events. Unfortunately I am looking for an event which is triggered when I query the data and such a predefined event does not exists. EntityCreatingEventData<>-Event is triggered when a new entity is inserted into the database not when a new entity object was created with data from the database.

Does anyone have another approach?

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?

Thank you very much! Everything is no working as expected and I can validate the access to my DevExpress Dashboard.

The problem is definitely the missing Authorization header. As soon as I send the get request with postman and add the authorization-header I have the correct user identity... now I have to find a way to modify the dashboard in the frontend to always send the authorization token. Is there a simple way in the angular frontend to get the Authorization token?

Hi @ismcagdas

The debug point will be hit when I send a request for the first time to the dashboard controller.

I have prepared a screencast for you: https://vimeo.com/403304170/35029fcf0d

You can actually directly access the server where I have taken the screencast from either by windows remote desktop or teamviewer. How can I pass you the secret credentials?

I have just realized that the requests which are sent by the dashboard component to the backend do not have the authentication header. Therefor it is actually clear that the backend can't recognize the user... I guess that I have to fix the problem on the frontend.

Regards, marco

Showing 1 to 10 of 24 entries