Add support for OIDC Configuration Provider
Closes gh-13210
This commit is contained in:
@@ -28,7 +28,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
|
||||
"APP-CLIENT-ID=my-client-id", "APP-CLIENT-SECRET=my-client-secret" })
|
||||
"APP-CLIENT-ID=my-client-id", "APP-CLIENT-SECRET=my-client-secret",
|
||||
"GOOGLE-CLIENT-ID=my-google-client-id",
|
||||
"GOOGLE-CLIENT-SECRET=my-google-client-secret" })
|
||||
public class SampleReactiveOAuth2ClientApplicationTests {
|
||||
|
||||
@Autowired
|
||||
@@ -36,17 +38,16 @@ public class SampleReactiveOAuth2ClientApplicationTests {
|
||||
|
||||
@Test
|
||||
public void everythingShouldRedirectToLogin() {
|
||||
this.webTestClient.get().uri("/").exchange()
|
||||
.expectStatus().isFound()
|
||||
.expectHeader().valueEquals("Location", "/login");
|
||||
this.webTestClient.get().uri("/").exchange().expectStatus().isFound()
|
||||
.expectHeader().valueEquals("Location", "/login");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loginShouldHaveBothOAuthClientsToChooseFrom() {
|
||||
byte[] body = this.webTestClient.get().uri("/login").exchange()
|
||||
.expectStatus().isOk()
|
||||
.returnResult(String.class).getResponseBodyContent();
|
||||
byte[] body = this.webTestClient.get().uri("/login").exchange().expectStatus()
|
||||
.isOk().returnResult(String.class).getResponseBodyContent();
|
||||
String bodyString = new String(body);
|
||||
assertThat(bodyString).contains("/oauth2/authorization/google");
|
||||
assertThat(bodyString).contains("/oauth2/authorization/github-client-1");
|
||||
assertThat(bodyString).contains("/oauth2/authorization/github-client-2");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user