Skip to content

Add Bearer Token Test Support #7528

Open
@jzheaux

Description

@jzheaux

Related to #6634

Testing authentication flows that include a JWT is straight-forward:

this.mvc.perform(get("/")
    .with(jwt(jwt -> jwt.subject("subject"))));

It'd be nice to have Resource Server support that doesn't care about the format"

this.mvc.perform(get("/")
    .with(bearer(b -> b.subject("subject"))));

While the first produces a JwtAuthenticationToken and Jwt principal, the second would produce a BearerTokenAuthentication and a OAuth2AuthenticatedPrincipal principal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: testAn issue in spring-security-testtype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions