Activities of "jlavallet"

Please see my post above before reading this post.

Here is something else I have tried:

As you can see from the screenshot above, I have:

(1) created an Account folder underneath the Pages folder in the BlueSpot.Web project.

(2) copied the abp-5.3.5\modules\account\src\Volo.Abp.Account.Web\Pages\Account\Logout.cshtml file to my new Account folder and have modified it to reference my CustomLogoutModel (below)

(3) extended the Volo.Abp.Account.Public.Web.Pages.Account.LogoutModel into a CustomLogoutModel class and have overridden the OnGetAsync() method. I have copied the body of the original method into the new method.

(4) run the application and attempted to log out - and…

(5) gotten a NullReferenceException because the IdentitySecurityLogManager is null.

What am I not understanding?

I added the typeof(LogoutModel) but as you can see in the screenshot that had no effect. I have done code comparisons between the working project I generated to isolate the custom login/logout model code and my existing project that I upgraded to v5.3.5 and I cannot see any differences that could account for the logout to fail under my existing project - but it does.

In my screenshot above I also point out the URL above the stack trace. The port (44339) is that of the BlueSpot.Web project – not the BlueSpot.IdentityServerproject (44362).

I mention the port because when I run the isolated solution, the logout works just fine, but I can tell that when I hover over the Logout menu item it is first navigating to the Web project at https://localhost:44339/Account/Logout and then something happens in the Volosoft code to redirect to the Identity Server.

I believe the problem is something in my existing Web project. The redirection is just not happening - the Web project is not navigating that route because the Web project Account.LogoutModelis not registered.

If you look at the code for the Web project, you can see that we have not overridden any Page\Account modules there:

So maybe the real question is where is the Account.LogoutModel registered? How did it get "unregistered"?

Can we WebEx?

Thanks for your help but that did not work. I am going to send you a zipped copy of my project. I think the problem has to do with the Web project.

Perfect. Thank you. Now I just have one more problem. I am getting the following error when I try to log out:

Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'Volo.Abp.Account.Public.Web.Pages.Account.LogoutModel' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageModelFactoryProvider.<>c__DisplayClass3_0.<CreateModelFactory>b__0(PageContext pageContext)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.CreateInstance()
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at StackifyMiddleware.RequestTracerMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\StackifyMiddleware\RequestTracerMiddleware.cs:line 168
   at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Do you have any idea what could be causing this?

I am also getting a similar exception when I click the Login to this Tenant link on the SaaS\Tenants page.

NOTE: These exceptions are coming from my original project and not the source code I sent to you.

So I used the ExposeServices tweak to register the IdentityServerSupportedLoginModel, changed my class to inherit from it, and I switched back to the call to the base constructor for that base class. Everything works including my code down below.

However, I can't understand why the Tenant selection is still showing. How do I hide that on the UI?


[ExposeServices(typeof(CustomLoginModel), typeof(IdentityServerSupportedLoginModel))]
public class CustomLoginModel : IdentityServerSupportedLoginModel
{
  private readonly ITenantRepository _tenantRepository;

  public CustomLoginModel(
    IAuthenticationSchemeProvider schemeProvider,
    IOptions<AbpAccountOptions> accountOptions,
    IAccountExternalProviderAppService accountExternalProvider,
    IIdentityServerInteractionService interaction,
    IClientStore clientStore,
    IEventService identityServerEvents,
    ICurrentPrincipalAccessor currentPrincipalAccessor,
    IAbpRecaptchaValidatorFactory recaptchaValidatorFactory,
    IOptions<IdentityOptions> identityOptions,
    IOptionsSnapshot<reCAPTCHAOptions> reCaptchaOptions,
    ITenantRepository tenantRepository)
    : base(schemeProvider, accountOptions, accountExternalProvider, interaction, clientStore, identityServerEvents,
      currentPrincipalAccessor, recaptchaValidatorFactory, identityOptions, reCaptchaOptions)
  {
    _tenantRepository = tenantRepository;
  }

  public override async Task<IActionResult> OnPostAsync(string action)
  {
    var user = await FindUserAsync(LoginInput.UserNameOrEmailAddress);
    using (CurrentTenant.Change(user?.TenantId))
    {
      return await base.OnPostAsync(action);
    }
  }

  public override async Task<IActionResult> OnGetExternalLoginCallbackAsync(string returnUrl = "",
    string returnUrlHash = "", string remoteError = null)
  {
    var user = await FindUserAsync(LoginInput.UserNameOrEmailAddress);
    using (CurrentTenant.Change(user?.TenantId))
    {
      return await base.OnGetExternalLoginCallbackAsync(returnUrl, returnUrlHash, remoteError);
    }
  }

  protected virtual async Task<IdentityUser> FindUserAsync(string uniqueUserNameOrEmailAddress)
  {
    IdentityUser user = null;
    using (CurrentTenant.Change(null))
    {
      user = await UserManager.FindByNameAsync(LoginInput.UserNameOrEmailAddress) ??
             await UserManager.FindByEmailAsync(LoginInput.UserNameOrEmailAddress);

      if (user != null)
      {
        return user;
      }
    }

    foreach (var tenant in await _tenantRepository.GetListAsync())
    {
      using (CurrentTenant.Change(tenant.Id))
      {
        user = await UserManager.FindByNameAsync(LoginInput.UserNameOrEmailAddress) ??
               await UserManager.FindByEmailAsync(LoginInput.UserNameOrEmailAddress);

        if (user != null)
        {
          return user;
        }
      }
    }

    return null;
  }
}

Removing all my code and reverting it back to what it was is not the solution I was looking for. I am trying to implement a solution whereby the tenant entry is not necessary. If you looked at my code you would see that. Can you try again?

the link has been deleted by admin

  • ABP Framework version: v 5.3.5

  • UI type MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Steps to reproduce the issue: I am replying to your message from a year ago because I have returned to this project and I’m still trying to work out the reason why I’m having trouble with the custom login solution. I have zipped up a project with two files added to the IdentityServer project. I believe the issue is that all the examples I have found are for the blended solution and not the tiered solution. Could you look at the attached – specifically the code in the AbpTest.IdentityServer’s Pages\Account folder that I added and suggest how to implement this for the tiered solution. AbpTest.zip

Thanks, From: ABP <noreply@abp.io>  Sent: Wednesday, February 16, 2022 6:42 PM Subject: Problem implementing Custom Login Model (#2572) Answered by maliming. — hi You can also send me your project and I'll download and check for issues. liming.ma@volosoft.com

You are receiving this because you are subscribed to this question. Do not reply to this email. Click here to view #2572 in browser.

  • ABP Framework version: v5.3.0

  • UI type:Blazor

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): Microservices

  • Exception message and stack trace:

PowerShell 7.2.4
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

Loading personal and system profiles took 516ms.
 passp    ~    ﮫ0ms⠀   abp suite update --p                                   pwsh   100  09:30:32 
[09:31:26 INF] ABP CLI (https://abp.io)
[09:31:27 INF] Version 5.3.0 (Stable)
[09:31:27 INF] Updating ABP Suite to the latest preview version...
Tool 'volo.abp.suite' was successfully updated from version '5.2.2' to version '5.3.0'.
 passp    ~    ﮫ23.854s⠀   abp suite                                                                             pwsh   100  09:31:45 
[09:33:41 INF] ABP CLI (https://abp.io)
[09:33:41 INF] Version 5.3.0 (Stable)
Starting Suite v5.3.0 ...
Opening http://localhost:3000
Press Ctrl+C to shut down.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated uppy@1.24.0: @uppy/image-editor was missing from package.json, fixed in v1.24.1
npm WARN deprecated flag-icon-css@4.1.7: The project has been renamed to flag-icons

added 510 packages, and audited 511 packages in 50s

11 packages are looking for funding
  run `npm fund` for details

24 vulnerabilities (5 moderate, 16 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated flag-icon-css@4.1.7: The project has been renamed to flag-icons

added 411 packages, and audited 412 packages in 30s

11 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (2 moderate, 12 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated flag-icon-css@4.1.7: The project has been renamed to flag-icons

added 409 packages, and audited 410 packages in 23s

11 packages are looking for funding
  run `npm fund` for details

13 vulnerabilities (2 moderate, 11 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\gateways\web-public\src\PWADC.GoRPMS.PublicWebGateway/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\gateways\web-public\src\PWADC.GoRPMS.PublicWebGateway\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_42_57_122Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\gateways\web\src\PWADC.GoRPMS.WebGateway/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\gateways\web\src\PWADC.GoRPMS.WebGateway\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_02_325Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\administration\src\PWADC.GoRPMS.AdministrationService.HttpApi.Host/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\administration\src\PWADC.GoRPMS.AdministrationService.HttpApi.Host\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_07_481Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\identity\src\PWADC.GoRPMS.IdentityService.HttpApi.Host/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\identity\src\PWADC.GoRPMS.IdentityService.HttpApi.Host\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_12_615Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\product\src\PWADC.GoRPMS.ProductService.HttpApi.Host/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\product\src\PWADC.GoRPMS.ProductService.HttpApi.Host\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_17_751Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\product\src\PWADC.GoRPMS.ProductService.Web/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\product\src\PWADC.GoRPMS.ProductService.Web\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_22_930Z-debug-0.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\saas\src\PWADC.GoRPMS.SaasService.HttpApi.Host/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Century\Clients\PigglyWiggly\RPMS\PWADC.GoRPMS\services\saas\src\PWADC.GoRPMS.SaasService.HttpApi.Host\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\passp\AppData\Local\npm-cache\_logs\2022-06-17T14_43_27_869Z-debug-0.log

  • Steps to reproduce the issue:"

I am running into an issue after using the ABP Suite to generate a microservices solution. During the generation of the solution, I get several errors that indicate that their is no package.json in several of the projects. I have confirmed that these files are missing. I have tried to generate the solution using both ABP Suite v 5.2.2 and ABP Suite v 5.3.0 after upgrading ABP to v 5.3.0 (it should be noticed that I had to use the preview flag to force ABP Suite to upgrade to v5.3.0).

See my Discord post: https://discord.com/channels/951497912645476422/953000230142496789/987375732621717646

I tried every combination of everything that I could find, and the certificate just would not be trusted. I am running a Windows Insider build of Windows 11 – perhaps that has something to do with something. Anyway, once I switched over to a remote work PC, I was able to get the certificate installed and trusted.

Showing 21 to 30 of 41 entries
Made with ❤️ on ABP v9.2.0-preview. Updated on January 14, 2025, 14:54