|
|
|
@ -269,8 +269,7 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests { |
|
|
|
this.server = new MockWebServer(); |
|
|
|
this.server = new MockWebServer(); |
|
|
|
this.server.start(); |
|
|
|
this.server.start(); |
|
|
|
String issuer = this.server.url("").toString(); |
|
|
|
String issuer = this.server.url("").toString(); |
|
|
|
String cleanIssuerPath = cleanIssuerPath(issuer); |
|
|
|
setupMockResponse(issuer); |
|
|
|
setupMockResponse(cleanIssuerPath); |
|
|
|
|
|
|
|
OAuth2ClientProperties.Registration registration = new OAuth2ClientProperties.Registration(); |
|
|
|
OAuth2ClientProperties.Registration registration = new OAuth2ClientProperties.Registration(); |
|
|
|
registration.setProvider("okta-oidc"); |
|
|
|
registration.setProvider("okta-oidc"); |
|
|
|
registration.setClientId("clientId"); |
|
|
|
registration.setClientId("clientId"); |
|
|
|
@ -297,7 +296,7 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests { |
|
|
|
assertThat(adapted.getAuthorizationGrantType()) |
|
|
|
assertThat(adapted.getAuthorizationGrantType()) |
|
|
|
.isEqualTo(AuthorizationGrantType.AUTHORIZATION_CODE); |
|
|
|
.isEqualTo(AuthorizationGrantType.AUTHORIZATION_CODE); |
|
|
|
assertThat(adapted.getRegistrationId()).isEqualTo("okta"); |
|
|
|
assertThat(adapted.getRegistrationId()).isEqualTo("okta"); |
|
|
|
assertThat(adapted.getClientName()).isEqualTo(cleanIssuerPath); |
|
|
|
assertThat(adapted.getClientName()).isEqualTo(issuer); |
|
|
|
assertThat(adapted.getScopes()).containsOnly("user"); |
|
|
|
assertThat(adapted.getScopes()).containsOnly("user"); |
|
|
|
assertThat(adapted.getRedirectUriTemplate()) |
|
|
|
assertThat(adapted.getRedirectUriTemplate()) |
|
|
|
.isEqualTo("http://example.com/redirect"); |
|
|
|
.isEqualTo("http://example.com/redirect"); |
|
|
|
@ -316,8 +315,7 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests { |
|
|
|
this.server = new MockWebServer(); |
|
|
|
this.server = new MockWebServer(); |
|
|
|
this.server.start(); |
|
|
|
this.server.start(); |
|
|
|
String issuer = this.server.url("").toString(); |
|
|
|
String issuer = this.server.url("").toString(); |
|
|
|
String cleanIssuerPath = cleanIssuerPath(issuer); |
|
|
|
setupMockResponse(issuer); |
|
|
|
setupMockResponse(cleanIssuerPath); |
|
|
|
|
|
|
|
OAuth2ClientProperties properties = new OAuth2ClientProperties(); |
|
|
|
OAuth2ClientProperties properties = new OAuth2ClientProperties(); |
|
|
|
Provider provider = new Provider(); |
|
|
|
Provider provider = new Provider(); |
|
|
|
provider.setIssuerUri(issuer); |
|
|
|
provider.setIssuerUri(issuer); |
|
|
|
@ -332,7 +330,7 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests { |
|
|
|
assertThat(adapted.getAuthorizationGrantType()) |
|
|
|
assertThat(adapted.getAuthorizationGrantType()) |
|
|
|
.isEqualTo(AuthorizationGrantType.AUTHORIZATION_CODE); |
|
|
|
.isEqualTo(AuthorizationGrantType.AUTHORIZATION_CODE); |
|
|
|
assertThat(adapted.getRegistrationId()).isEqualTo("okta"); |
|
|
|
assertThat(adapted.getRegistrationId()).isEqualTo("okta"); |
|
|
|
assertThat(adapted.getClientName()).isEqualTo(cleanIssuerPath); |
|
|
|
assertThat(adapted.getClientName()).isEqualTo(issuer); |
|
|
|
assertThat(adapted.getScopes()).containsOnly("openid"); |
|
|
|
assertThat(adapted.getScopes()).containsOnly("openid"); |
|
|
|
assertThat(providerDetails.getAuthorizationUri()) |
|
|
|
assertThat(providerDetails.getAuthorizationUri()) |
|
|
|
.isEqualTo("https://example.com/o/oauth2/v2/auth"); |
|
|
|
.isEqualTo("https://example.com/o/oauth2/v2/auth"); |
|
|
|
|