Search in sources :

Example 1 with LinkedIn2Client

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

the class DelegatedClientFactory method configureLinkedInClient.

/**
 * Configure linked in client.
 *
 * @param properties the properties
 */
protected void configureLinkedInClient(final Collection<BaseClient> properties) {
    final Pac4jDelegatedAuthenticationProperties.LinkedIn ln = pac4jProperties.getLinkedIn();
    if (StringUtils.isNotBlank(ln.getId()) && StringUtils.isNotBlank(ln.getSecret())) {
        final LinkedIn2Client client = new LinkedIn2Client(ln.getId(), ln.getSecret());
        configureClient(client, ln);
        if (StringUtils.isNotBlank(ln.getScope())) {
            client.setScope(ln.getScope());
        }
        if (StringUtils.isNotBlank(ln.getFields())) {
            client.setFields(ln.getFields());
        }
        LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
        properties.add(client);
    }
}
Also used : LinkedIn2Client(org.pac4j.oauth.client.LinkedIn2Client) Pac4jDelegatedAuthenticationProperties(org.apereo.cas.configuration.model.support.pac4j.Pac4jDelegatedAuthenticationProperties)

Example 2 with LinkedIn2Client

use of org.pac4j.oauth.client.LinkedIn2Client in project pac4j by pac4j.

the class RunLinkedIn2Client method getClient.

@Override
protected IndirectClient getClient() {
    final LinkedIn2Client client = new LinkedIn2Client();
    client.setKey("gsqj8dn56ayn");
    client.setSecret("kUFAZ2oYvwMQ6HFl");
    client.setScope("r_basicprofile r_emailaddress rw_company_admin w_share");
    client.setCallbackUrl(PAC4J_URL);
    return client;
}
Also used : LinkedIn2Client(org.pac4j.oauth.client.LinkedIn2Client)

Example 3 with LinkedIn2Client

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

the class DefaultDelegatedClientFactory method configureLinkedInClient.

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

Example 4 with LinkedIn2Client

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

the class Pac4jAuthenticationEventExecutionPlanConfiguration method configureLinkedInClient.

private void configureLinkedInClient(final Collection<BaseClient> properties) {
    final Pac4jProperties.LinkedIn ln = casProperties.getAuthn().getPac4j().getLinkedIn();
    if (StringUtils.isNotBlank(ln.getId()) && StringUtils.isNotBlank(ln.getSecret())) {
        final LinkedIn2Client client = new LinkedIn2Client(ln.getId(), ln.getSecret());
        if (StringUtils.isNotBlank(ln.getScope())) {
            client.setScope(ln.getScope());
        }
        if (StringUtils.isNotBlank(ln.getFields())) {
            client.setFields(ln.getFields());
        }
        properties.add(client);
    }
}
Also used : Pac4jProperties(org.apereo.cas.configuration.model.support.pac4j.Pac4jProperties) LinkedIn2Client(org.pac4j.oauth.client.LinkedIn2Client)

Aggregations

LinkedIn2Client (org.pac4j.oauth.client.LinkedIn2Client)4 lombok.val (lombok.val)1 Pac4jDelegatedAuthenticationProperties (org.apereo.cas.configuration.model.support.pac4j.Pac4jDelegatedAuthenticationProperties)1 Pac4jProperties (org.apereo.cas.configuration.model.support.pac4j.Pac4jProperties)1