Skip to content

ICurrentPrincipalAccessor.ClaimsPrincipal is sometimes null #25747

Description

@mavado83

Is there an existing issue for this?

  • I have searched the existing issues

Description

although stated that the Principal cannot be null, it can happen...

Image

Visual Studio tells me that I can safely remove the '?' but then I got an exception.

Maybe it goes wrong here? https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Security/Volo/Abp/Security/Claims/ThreadCurrentPrincipalAccessor.cs

This can return null in runtime as a fallback..


public interface ICurrentPrincipalAccessor
{
  ClaimsPrincipal Principal { get; }

  IDisposable Change(ClaimsPrincipal principal);
}

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

10.4

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions