Skip to content

Add oidcLogin MockMvc Test Support #7618

Closed
@jzheaux

Description

@jzheaux

Related to #6634.

It'd be handy to have test support for oidcLogin:

this.mvc.perform(get("/").with(oidcLogin()));

or

this.mvc.perform(get("/")
    .with(oidcLogin().authorities(new SimpleGrantedAuthority("SCOPE_read")));

The result would be an OAuth2AuthenticationToken as well as an OAuth2AuthorizedClient.

Ideally, tests would work with controllers using @AuthenticatedPrincipal as well as @RegisteredOAuth2AuthorizedClient annotations.

Metadata

Metadata

Assignees

Labels

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