Base solution for your next web application

Activities of "Mepgovlic"

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version?
  • 10
  • What is your product type (Angular or MVC)?
  • Angular
  • What is product framework type (.net framework or .net core)?
  • core

We would like to run ASPNETZERO under IIS using Windows Authentication, using ADFS or LDAP is not we are trying to achieve. We tried some solutions but they are not complete, the application keeps prompting for login. We need to override passing the token in the file AbpHttpInterceptor, your input is highly appreciated to overide passing the token in the AbpHttpInterceptor.

Best regards, Anas.

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version?
  • ASPNETZERO v10
  • What is your product type (Angular or MVC)?
  • Angular
  • What is product framework type (.net framework or .net core)?
  • .NET 5

If issue related with ABP Framework

  • What is ABP Framework version?

If issue is about UI

  • Which theme are you using?
  • What are the theme settings?

We setup ASPNETZERO to use windows authentication as stated in this article on stackoverflow: https://stackoverflow.com/questions/48820965/integrated-windows-authentication-in-abp-framework

It works fine on IISExpress after enabling windows authentication and disabling anonymous authentication, the current user is identified and his profile is created and he is assigned Admin role by default. But when we publish to IIS we get an error in the call AbpUserConfiguration/GetAll forbidden 401 as shown in the screenshot below.

We also updated the AuthConfigurer and added: var authenticationBuilder = services.AddAuthentication(IISDefaults.AuthenticationScheme);

Kindly how can we debug this, we couldn't find the AbpUserConfiguration/GetAll controller or application service, we need to debug the Authorize attribute as well, your support is highly appreciated.

My question regarding downloading a project, I wanted to update a current project to the latest version, so I generated a new project with the same name but with the latest version but that counted a download of my license, how can I undo this action please?

Hello,

Thank you for your response, but It is not the solution that we are looking for, we already tested LDAP and it is working but as I was informed by the team, if we enable the LDAP we will lose the Multitenancy feature which is a very important feature in our case we have at least 3 tenants.

Regards, Anas Nabelsi.

Hello,

We started a new project based on ASPNETZERO the template of ASP.NET Core and Angular 9. We would like to enable our users to access the application using their active directory account and without being prompted to enter username and password.

We followed some articles in the documentation and some posts in stackoverflow but we are not able to get this to work, here is what we did:

  • In login.component.ts we added the following lines in ngOnInit (We added the appsettings and its initialization in AppConsts as well): if (AppConsts.isWindowsAuthentication == true) { this.loginService.authenticateModel.userNameOrEmailAddress = 'foo'; this.loginService.authenticateModel.password = 'bar'; this.login(); }
  • In the project MyProject.Core we added the following external auth source: public class AlwaysTrueExternalAuthSource : DefaultExternalAuthenticationSource<Tenant, User>, ITransientDependency { public override string Name => "AlwaysTrueExternalAuthSource"; public override Task TryAuthenticateAsync(string userNameOrEmailAddress, string plainPassword, Tenant tenant) { return Task.FromResult(true); } }
  • In the file CoreModule class and in the PreInitialize method we added the follow: Configuration.Modules.Zero().UserManagement.ExternalAuthenticationSources.Add<AlwaysTrueExternalAuthSource>();
  • In the project MyProject.Web.Core in the TokenAuthController in the Authenticate method we added the following lines: var windowsIdentity = WindowsIdentity.GetCurrent(); model.UserNameOrEmailAddress = windowsIdentity.Name.ToLowerInvariant(); model.UserNameOrEmailAddress = model.UserNameOrEmailAddress.Substring(model.UserNameOrEmailAddress.IndexOf("\\") + 1);

We published the application to IIS and when we browse the application, we are redirected to the login page and the username and password are by default filled with foo and bar and then the login process is triggered and the page is redirected.

  • On Chrome
    • We are presented with the windows authentication prompt for user and if we enter the user we keep getting the prompt again and again and in the console we get this error if we cancel: AbpUserConfiguration/GetAll?d=1591821199097 net::ERR_CONNECTION_RESET 401 (Unauthorized)
  • On Edge
    • We have the same scenario except that we are not prompted with the windows authentication prompt to login and we get the following error in the console:

Notes: We published the application to IIS and we enabled Windows Authentication and we also installed IIS CORS Module and configured it although this is not required because we are using a signle application to host both backend and frontend applications.

Your support is highly appreciated, this should be easy task following the documentation but it is not getting to work and we have spent 2 days on this and we can't be delayed more.

Best regards, Anas Nabelsi.

Showing 1 to 5 of 5 entries