Skip to content

Commit

Permalink
Litt renere
Browse files Browse the repository at this point in the history
  • Loading branch information
jolarsen committed Aug 22, 2024
1 parent d872918 commit 4a22f2d
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ private static OpenIDConfiguration createStsConfiguration(String wellKnownUrl) {
private static OpenIDConfiguration createAzureAppConfiguration(String azureKonfigUrl) {
var proxyUrl = (ENV.isFss() && ENV.isProd()) ? ProxyProperty.getProxy() : null;
return createConfiguration(OpenIDProvider.AZUREAD,
getPropertyOrWellKnown(AzureProperty.AZURE_OPENID_CONFIG_ISSUER.name(), () -> getIssuerFra(azureKonfigUrl, proxyUrl)),
getPropertyOrWellKnown(AzureProperty.AZURE_OPENID_CONFIG_JWKS_URI.name(), () -> getJwksFra(azureKonfigUrl, proxyUrl)),
getPropertyOrWellKnown(AzureProperty.AZURE_OPENID_CONFIG_TOKEN_ENDPOINT.name(), () -> getTokenEndpointFra(azureKonfigUrl, proxyUrl)),
getPropertyOrWellKnown(getAzureProperty(AzureProperty.AZURE_OPENID_CONFIG_ISSUER), () -> getIssuerFra(azureKonfigUrl, proxyUrl)),
getPropertyOrWellKnown(getAzureProperty(AzureProperty.AZURE_OPENID_CONFIG_JWKS_URI), () -> getJwksFra(azureKonfigUrl, proxyUrl)),
getPropertyOrWellKnown(getAzureProperty(AzureProperty.AZURE_OPENID_CONFIG_TOKEN_ENDPOINT), () -> getTokenEndpointFra(azureKonfigUrl, proxyUrl)),
(ENV.isFss() && ENV.isProd()),
proxyUrl,
getAzureProperty(AzureProperty.AZURE_APP_CLIENT_ID),
Expand All @@ -128,9 +128,9 @@ private static OpenIDConfiguration createAzureAppConfiguration(String azureKonfi

private static OpenIDConfiguration createTokenXConfiguration(String tokenxKonfigUrl) {
return createConfiguration(OpenIDProvider.TOKENX,
getPropertyOrWellKnown(TokenXProperty.TOKEN_X_ISSUER.name(), () -> getIssuerFra(tokenxKonfigUrl)),
getPropertyOrWellKnown(TokenXProperty.TOKEN_X_JWKS_URI.name(), () -> getJwksFra(tokenxKonfigUrl)),
getPropertyOrWellKnown(TokenXProperty.TOKEN_X_TOKEN_ENDPOINT.name(), () -> getTokenEndpointFra(tokenxKonfigUrl)),
getPropertyOrWellKnown(getTokenXProperty(TokenXProperty.TOKEN_X_ISSUER), () -> getIssuerFra(tokenxKonfigUrl)),
getPropertyOrWellKnown(getTokenXProperty(TokenXProperty.TOKEN_X_JWKS_URI), () -> getJwksFra(tokenxKonfigUrl)),
getPropertyOrWellKnown(getTokenXProperty(TokenXProperty.TOKEN_X_TOKEN_ENDPOINT), () -> getTokenEndpointFra(tokenxKonfigUrl)),
false,
null,
getTokenXProperty(TokenXProperty.TOKEN_X_CLIENT_ID),
Expand All @@ -139,8 +139,8 @@ private static OpenIDConfiguration createTokenXConfiguration(String tokenxKonfig
false);
}

private static String getPropertyOrWellKnown(String propertyname, Supplier<Optional<String>> wellknownSupplier) {
return getProperty(propertyname)
private static String getPropertyOrWellKnown(String property, Supplier<Optional<String>> wellknownSupplier) {
return Optional.ofNullable(property)
.or(wellknownSupplier)
.orElse(null);
}
Expand Down

0 comments on commit 4a22f2d

Please sign in to comment.