Skip to content

Commit

Permalink
add jhipster property to configured custom auth0 uris
Browse files Browse the repository at this point in the history
  • Loading branch information
atomfrede committed Nov 30, 2023
1 parent 7c7266e commit 3d2b47a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -850,13 +850,23 @@ public void setKey(String key) {
public static class OAuth2 {
private List<String> audience = new ArrayList<>();

private List<String> auth0IssuerUris = new ArrayList<>();

public List<String> getAudience() {
return Collections.unmodifiableList(audience);
}

public void setAudience(@NotNull List<String> audience) {
this.audience.addAll(audience);
}

public List<String> getAuth0IssuerUris() {
return Collections.unmodifiableList(auth0IssuerUris);
}

public void setAuth0IssuerUris(List<String> auth0IssuerUris) {
this.auth0IssuerUris.addAll(auth0IssuerUris);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,17 @@ void testSecurityOauth2Audience() {
assertThat(obj.getAudience()).contains("default", "account");
}

@Test
void testSecurityOauth2Auth0IssuerUris() {
JHipsterProperties.Security.OAuth2 obj = properties.getSecurity().getOauth2();
assertThat(obj).isNotNull();
assertThat(obj.getAuth0IssuerUris()).isNotNull().isEmpty();

obj.setAuth0IssuerUris(Arrays.asList("auth0.com", "my-custom-auth0.org"));
assertThat(obj.getAuth0IssuerUris()).isNotEmpty().size().isEqualTo(2);
assertThat(obj.getAuth0IssuerUris()).contains("auth0.com", "my-custom-auth0.org");
}

@Test
void testApiDocsTitle() {
JHipsterProperties.ApiDocs obj = properties.getApiDocs();
Expand Down

0 comments on commit 3d2b47a

Please sign in to comment.