Skip to content

JwtAuthenticationToken.principal and JwtAuthenticationToken.Builder.principal types do not match #19333

@kalgon

Description

@kalgon

When I create a JwtAuthenticationToken through its constructor, I can pass my own custom principal class (which is not required to implement any interface or extend any class).

If I create a JwtAuthenticationToken through its builder, the principal must be of type Jwt.

Why are the requirements on the principal type different? Can the types be aligned?

Also, why does BearerTokenAuthentication force the principal to implement OAuth2AuthenticatedPrincipal, it would be great if I could use my own custom princpal class (without any type requirement) like I do with JwtAuthenticationToken.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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