Skip to content

Commit

Permalink
Add a test where we configure the issuer. Note this one is the same i…
Browse files Browse the repository at this point in the history
…ssuer, but the server gets it from the config.

[#121653769] https://www.pivotaltracker.com/story/show/121653769
  • Loading branch information
fhanik committed Jun 30, 2016
1 parent 9cbd192 commit 94a7c20
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -125,7 +125,21 @@ public void scopesIncludedInAuthorizeRequest() throws Exception {
Assert.assertThat(webDriver.findElement(By.linkText("My OIDC Provider")).getAttribute("href"), Matchers.containsString("scope=openid+cloud_controller.read"));
}

@Test
public void scopesIncludedInAuthorizeRequest_When_Issuer_Set() throws Exception {
createOIDCProviderWithRequestedScopes("https://oidc10.identity.cf-app.com/oauth/token");
try {
webDriver.get(appUrl);
} finally {
IntegrationTestUtils.takeScreenShot(webDriver);
}
Assert.assertThat(webDriver.findElement(By.linkText("My OIDC Provider")).getAttribute("href"), Matchers.containsString("scope=openid+cloud_controller.read"));
}

private void createOIDCProviderWithRequestedScopes() throws Exception {
createOIDCProviderWithRequestedScopes(null);
}
private void createOIDCProviderWithRequestedScopes(String issuer) throws Exception {
IdentityProvider<AbstractXOAuthIdentityProviderDefinition> identityProvider = new IdentityProvider<>();
identityProvider.setName("my oidc provider");
identityProvider.setIdentityZoneId(OriginKeys.UAA);
Expand All @@ -139,6 +153,7 @@ private void createOIDCProviderWithRequestedScopes() throws Exception {
config.setSkipSslValidation(true);
config.setRelyingPartyId("identity");
config.setRelyingPartySecret("identitysecret");
config.setIssuer(issuer);
List<String> requestedScopes = new ArrayList<>();
requestedScopes.add("openid");
requestedScopes.add("cloud_controller.read");
Expand Down

0 comments on commit 94a7c20

Please sign in to comment.