Skip to content

Mock Jwt Support should accept a fully-configured Jwt #6896

Closed
@jzheaux

Description

@jzheaux

A tester can configure a mock request with a Jwt like so:

this.mvc.perform(get("/")
    .with(jwt()))
// ...

Or like so:

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

It'd be nice to also accept a fully-configured Jwt:

Jwt jwt = // ...
this.mvc.perform(get("/")
    .with(jwt(jwt)))
// ...

Both on the servlet side as well as the reactive side:

Jwt jwt = // ...
this.client
    .mutateWith(mockJwt(jwt))
// ...

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)in: testAn issue in spring-security-testtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions