use of com.microsoft.azure.oidc.configuration.endpoint.EndPoint in project azure-tools-for-java by Microsoft.
the class SimpleConfigurationLoader method load.
public Configuration load() {
try {
final JsonNode wellKnownNode = futureHelper.getResult(wellKnownLoader.loadAsync());
if (wellKnownNode == null) {
LOGGER.error("Error loading metadata");
return null;
}
final List<Algorithm> algorithms = wellKnownParser.getAlgorithms(wellKnownNode);
final EndPoint authenticationEndPoint = wellKnownParser.getAuthenticationEndPoint(wellKnownNode);
final EndPoint keyStoreEndPoint = wellKnownParser.getKeyStoreEndPoint(wellKnownNode);
final EndPoint logoutEndPoint = wellKnownParser.getLogoutEndPoint(wellKnownNode);
final Issuer issuer = wellKnownParser.getIssuer(wellKnownNode);
final JsonNode keyStoreNode = futureHelper.getResult(keyStoreLoader.loadAsync(keyStoreEndPoint));
if (keyStoreNode == null) {
LOGGER.error("Error loading keystore");
return null;
}
final Map<Name, Key> keys = keyStoreParser.getKeys(keyStoreNode);
return configurationFactory.createConfiguration(algorithms, keys, issuer, authenticationEndPoint, logoutEndPoint);
} catch (RuntimeException e) {
LOGGER.error(e.getMessage(), e);
return null;
}
}
Aggregations