Support authorization_code grant for OAuth2 client
This commit also refactors OAuth2 client properties. With the added support for authorization_code clients, client registrations are now divided into `login` and `authorization_code`. An environment post processor is used for backward compatibility with old Open ID Connect login clients. Closes gh-13812
This commit is contained in:
@@ -53,7 +53,7 @@ public class SampleOAuth2ClientApplicationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loginShouldHaveBothOAuthClientsToChooseFrom() {
|
||||
public void loginShouldHaveBothOAuth2LoginClientsToChooseFrom() {
|
||||
ResponseEntity<String> entity = this.restTemplate.getForEntity("/login",
|
||||
String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -62,4 +62,12 @@ public class SampleOAuth2ClientApplicationTests {
|
||||
assertThat(entity.getBody()).contains("/oauth2/authorization/github-client-2");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void authorizationCodeClientIsPresent() {
|
||||
ResponseEntity<String> entity = this.restTemplate.getForEntity("/login",
|
||||
String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody()).contains("/oauth2/authorization/github-repos");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user