Update sample with placeholders for oauth client

pull/10504/merge
Madhura Bhave 7 years ago
parent 9692abba70
commit 9f1ed197d2

@ -110,7 +110,7 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests {
assertThat(adapted.getAuthorizationGrantType()).isEqualTo(
org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE);
assertThat(adapted.getRedirectUri()).isEqualTo(
"{scheme}://{serverName}:{serverPort}{contextPath}/oauth2/authorize/code/{clientAlias}");
"{scheme}://{serverName}:{serverPort}{contextPath}/oauth2/authorize/code/{registrationId}");
assertThat(adapted.getScope()).containsExactly("openid", "profile", "email",
"address", "phone");
assertThat(adapted.getClientName()).isEqualTo("Google");

@ -4,15 +4,15 @@ spring:
client:
registration:
github-client-1:
client-id: 1b4c6c2d23a2dbec8959
client-secret: 8bdb4047d98f37e1c6aeba9ffd2017bc31682e1b
client-id: ${APP-CLIENT-ID}
client-secret: ${APP-CLIENT-SECRET}
client-name: Github user
provider: github
scope: user
redirect_uri: http://localhost:8080/oauth2/authorize/code/github
github-client-2:
client-id: 1b4c6c2d23a2dbec8959
client-secret: 8bdb4047d98f37e1c6aeba9ffd2017bc31682e1b
client-id: ${APP-CLIENT-ID}
client-secret: ${APP-CLIENT-SECRET}
client-name: Github email
provider: github
scope: user:email

@ -22,7 +22,8 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Madhura Bhave
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
"APP-CLIENT-ID=my-client-id", "APP-CLIENT-SECRET=my-client-secret" })
@DirtiesContext
public class SampleOAuth2ClientApplicationTests {

Loading…
Cancel
Save