Search in sources :

Example 1 with UmaMetadataService

use of org.xdi.oxauth.client.uma.UmaMetadataService in project oxTrust by GluuFederation.

the class AppInitializer method initUmaMetadataConfiguration.

@Produces
@ApplicationScoped
@Named("umaMetadataConfiguration")
public UmaMetadata initUmaMetadataConfiguration() throws OxIntializationException {
    String umaConfigurationEndpoint = getUmaConfigurationEndpoint();
    if (StringHelper.isEmpty(umaConfigurationEndpoint)) {
        return null;
    }
    UmaMetadataService metaDataConfigurationService = UmaClientFactory.instance().createMetadataService(umaConfigurationEndpoint);
    UmaMetadata metadataConfiguration = metaDataConfigurationService.getMetadata();
    if (metadataConfiguration == null) {
        throw new OxIntializationException("UMA meta data configuration is invalid!");
    }
    return metadataConfiguration;
}
Also used : UmaMetadata(org.xdi.oxauth.model.uma.UmaMetadata) OxIntializationException(org.xdi.exception.OxIntializationException) UmaMetadataService(org.xdi.oxauth.client.uma.UmaMetadataService) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

ApplicationScoped (javax.enterprise.context.ApplicationScoped)1 Produces (javax.enterprise.inject.Produces)1 Named (javax.inject.Named)1 OxIntializationException (org.xdi.exception.OxIntializationException)1 UmaMetadataService (org.xdi.oxauth.client.uma.UmaMetadataService)1 UmaMetadata (org.xdi.oxauth.model.uma.UmaMetadata)1