-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
in: testAn issue in spring-security-testAn issue in spring-security-testtype: enhancementA general enhancementA general enhancement
Milestone
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.
Metadata
Metadata
Assignees
Labels
in: testAn issue in spring-security-testAn issue in spring-security-testtype: enhancementA general enhancementA general enhancement