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);
}
}
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;
}
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);
}
}
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);
}
}
Aggregations