Closed
Description
Related to #7618
When testing applications that use OAuth 2.0 Login, it would be nice to have MockMvc support like:
this.mvc(get("/")
.with(oauth2Login()));
or
this.mvc(get("/")
.with(oauth2Login()
.attribute("name", "value")
.authorities(new SimpleGrantedAuthority("SCOPE_read")));
as well as other builder methods relative to generating an authentication statement around an OAuth2User
principal.
Note that the attribute
method is necessary since the OAuth 2.0 spec doesn't specify any particular claims. It, then, correlates to the idToken
and userInfo
methods in the oidcLogin()
MockMvc support.