Simplify opaqueToken support
Remove scopes convenience method to alleviate potential confusion with the "scope" attribute. Issue gh-7827 Issue gh-7712
This commit is contained in:
@@ -90,20 +90,6 @@ public class SecurityMockServerConfigurerOpaqueTokenTests extends AbstractMockSe
|
||||
.containsOnly(this.authority1, this.authority2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mockOpaqueTokenWhenScopesThenBearerTokenAuthentication() {
|
||||
this.client
|
||||
.mutateWith(mockOpaqueToken().scopes("scoped", "authorities"))
|
||||
.get()
|
||||
.exchange()
|
||||
.expectStatus().isOk();
|
||||
|
||||
SecurityContext context = securityContextController.removeSecurityContext();
|
||||
assertThat((List<GrantedAuthority>) context.getAuthentication().getAuthorities())
|
||||
.containsOnly(new SimpleGrantedAuthority("SCOPE_scoped"),
|
||||
new SimpleGrantedAuthority("SCOPE_authorities"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mockOpaqueTokenWhenAttributesThenBearerTokenAuthentication() {
|
||||
String sub = new String("my-subject");
|
||||
|
||||
@@ -89,13 +89,6 @@ public class SecurityMockMvcRequestPostProcessorsOpaqueTokenTests {
|
||||
.andExpect(status().isForbidden());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void opaqueTokenWhenAuthoritiesSpecifiedThenGrantsAccess() throws Exception {
|
||||
this.mvc.perform(get("/admin/scopes")
|
||||
.with(opaqueToken().scopes("admin", "read")))
|
||||
.andExpect(content().string("[\"SCOPE_admin\",\"SCOPE_read\"]"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void opaqueTokenWhenAttributeSpecifiedThenUserHasAttribute() throws Exception {
|
||||
this.mvc.perform(get("/opaque-token/iss")
|
||||
|
||||
Reference in New Issue
Block a user