Skip to content

Use TimeProvider instead of DateTimeOffset in UserManager #62796

@bpiccand

Description

@bpiccand

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I am trying to implement integration tests in my application that uses the Identity package. I want to test that the user lockout feature is correctly configured in my application and am using the TimeProvider and FakeTimeProvider which where introduced with .NET 8 to ensure the user is not locked anymore after the desired amount of time.

Unfortunately, the UserManager class still uses the static DateTimeOffset instead of the new TimeProvider and therefore does not react to time changes in my tests.

Describe the solution you'd like

Replace the DateTimeOffset class with the TimeProvider to determine the current time in the Identity package

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-identityIncludes: Identity and providershelp wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions