use of org.xdi.oxauth.client.uma.UmaConfigurationService in project oxAuth by GluuFederation.
the class MetaDataFlowHttpTest method testGetUmaMetaDataConfiguration.
/**
* Test for getting meta data configuration
*/
@Test
@Parameters({ "umaMetaDataUrl" })
public void testGetUmaMetaDataConfiguration(final String umaMetaDataUrl) throws Exception {
showTitle("testGetUmaMetaDataConfiguration");
UmaConfigurationService metaDataConfigurationService = UmaClientFactory.instance().createMetaDataConfigurationService(umaMetaDataUrl);
// Get meta data configuration
UmaConfiguration c = null;
try {
c = metaDataConfigurationService.getMetadataConfiguration();
} catch (ClientResponseFailure ex) {
System.err.println(ex.getResponse().getEntity(String.class));
throw ex;
}
UmaTestUtil.assert_(c);
}
use of org.xdi.oxauth.client.uma.UmaConfigurationService in project oxTrust by GluuFederation.
the class AppInitializer method initUmaMetadataConfiguration.
@Produces
@ApplicationScoped
@Named("umaMetadataConfiguration")
public UmaConfiguration initUmaMetadataConfiguration() throws OxIntializationException {
String umaConfigurationEndpoint = getUmaConfigurationEndpoint();
if (StringHelper.isEmpty(umaConfigurationEndpoint)) {
return null;
}
UmaConfigurationService metaDataConfigurationService = UmaClientFactory.instance().createMetaDataConfigurationService(umaConfigurationEndpoint);
UmaConfiguration metadataConfiguration = metaDataConfigurationService.getMetadataConfiguration();
if (metadataConfiguration == null) {
throw new OxIntializationException("UMA meta data configuration is invalid!");
}
return metadataConfiguration;
}
Aggregations