Search in sources :

Example 1 with HiOrgServerClient

use of org.pac4j.oauth.client.HiOrgServerClient in project cas by apereo.

the class DefaultDelegatedClientFactory method configureHiOrgServerClient.

/**
 * Configure HiOrg-Server client.
 *
 * @param properties the properties
 */
protected void configureHiOrgServerClient(final Collection<IndirectClient> properties) {
    val pac4jProperties = casProperties.getAuthn().getPac4j();
    val hiOrgServer = pac4jProperties.getHiOrgServer();
    if (hiOrgServer.isEnabled() && StringUtils.isNotBlank(hiOrgServer.getId()) && StringUtils.isNotBlank(hiOrgServer.getSecret())) {
        val client = new HiOrgServerClient(hiOrgServer.getId(), hiOrgServer.getSecret());
        configureClient(client, hiOrgServer);
        if (StringUtils.isNotBlank(hiOrgServer.getScope())) {
            client.getConfiguration().setScope(hiOrgServer.getScope());
        }
        LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
        properties.add(client);
    }
}
Also used : lombok.val(lombok.val) HiOrgServerClient(org.pac4j.oauth.client.HiOrgServerClient)

Aggregations

lombok.val (lombok.val)1 HiOrgServerClient (org.pac4j.oauth.client.HiOrgServerClient)1