Add @transient to OAuth2IntrospectionAuthenticationToken

fixes gh-6829
This commit is contained in:
Florian Aumeier
2019-05-29 11:50:22 +02:00
committed by Josh Cummings
parent e15922322e
commit 9fe8949883
2 changed files with 18 additions and 0 deletions

View File

@@ -564,6 +564,22 @@ public class OAuth2ResourceServerConfigurerTests {
assertThat(result.getRequest().getSession(false)).isNull();
}
@Test
public void requestWhenIntrospectionConfiguredThenSessionIsNotCreated()
throws Exception {
this.spring.register(RestOperationsConfig.class, OpaqueTokenConfig.class, BasicController.class).autowire();
mockRestOperations(json("Active"));
MvcResult result = this.mvc.perform(get("/authenticated")
.with(bearerToken("token")))
.andExpect(status().isOk())
.andExpect(content().string("test-subject"))
.andReturn();
assertThat(result.getRequest().getSession(false)).isNull();
}
@Test
public void requestWhenUsingDefaultsAndNoBearerTokenThenSessionIsCreated()
throws Exception {