Skip to content

[Feature Request] Make the ClaimConstants class public again #100

Description

@o1oo11oo

Is your feature request related to a problem? Please describe.
As part of a web API, we're using integration tests with a custom authentication handler like the one suggested on the Microsoft Docs. To build a similar ClaimsPrincipal and have the extension functions like User.GetObjectId() working, I'm adding a bunch of claims from ClaimConstants to the principal, namely Name, ObjectId and PreferredUserName. This stopped working after #75 was merged, because the ClaimConstants class was set to internal.

Describe the solution you'd like
To me it seems like the easiest solution is to set the ClaimConstants class to public again, or provide a limited subset of claims, that can be public, if not everything should be publically available.

Describe alternatives you've considered
I could copy the constants I need from ClaimConstants or just define those as strings where I need them, but that might break in case those claims get changed at some point. Having them as constants that can be used prevents that.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions