Open Closed

ProfileAppService.GetAsync problem #1761


User avatar
0
nikolay.nikolov@solutionking.com created

Hello guys. I have a question. Is it posible to load the profile after custom login with: await ProfileAppService.GetAsync(); and then to update it with ProfileAppService.UpdateAsync(...

When I try to do that I receive an error:

Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.

Here is a part of my code:

await SignInManager.SignInAsync(user, isPersistent: false);

await IdentityServerEvents.RaiseAsync(new UserLoginSuccessEvent(user.UserName, user.Id.ToString(), user.UserName));

then:

var profile = await ProfileAppService.GetAsync(); (this is the exception place)

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    2
    maliming created
    Support Team Fullstack Developer

    HI

    You can try to use CurrentPrincipalAccessor.Change.

    //ICurrentPrincipalAccessor CurrentPrincipalAccessor;
    
    await SignInManager.SignInAsync(user, isPersistent: false);
    using (CurrentPrincipalAccessor.Change(await SignInManager.CreateUserPrincipalAsync(user)))
    {
        var profile = await ProfileAppService.GetAsync();
    }
    
    
    
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.