Search in sources :

Example 1 with FoursquareClient

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

the class Pac4jAuthenticationEventExecutionPlanConfiguration method configureFoursquareClient.

private void configureFoursquareClient(final Collection<BaseClient> properties) {
    final Pac4jProperties.Foursquare foursquare = casProperties.getAuthn().getPac4j().getFoursquare();
    if (StringUtils.isNotBlank(foursquare.getId()) && StringUtils.isNotBlank(foursquare.getSecret())) {
        final FoursquareClient client = new FoursquareClient(foursquare.getId(), foursquare.getSecret());
        properties.add(client);
    }
}
Also used : FoursquareClient(org.pac4j.oauth.client.FoursquareClient) Pac4jProperties(org.apereo.cas.configuration.model.support.pac4j.Pac4jProperties)

Example 2 with FoursquareClient

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

the class RunFoursquareClient method getClient.

@Override
protected IndirectClient getClient() {
    final FoursquareClient foursquareClient = new FoursquareClient();
    foursquareClient.setKey("CONTW2V0SBAHTMXMUA2G1I2P55WGRVJLGBLNY2CFSG1JV4DQ");
    foursquareClient.setSecret("EVAZNDHEQODSIPOKC13JAAPMR3IJRSMLE55TYUW3VYRY3VTC");
    foursquareClient.setCallbackUrl(PAC4J_BASE_URL);
    return foursquareClient;
}
Also used : FoursquareClient(org.pac4j.oauth.client.FoursquareClient)

Example 3 with FoursquareClient

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

the class DefaultDelegatedClientFactory method configureFoursquareClient.

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

Example 4 with FoursquareClient

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

the class DelegatedClientFactory method configureFoursquareClient.

/**
 * Configure foursquare client.
 *
 * @param properties the properties
 */
protected void configureFoursquareClient(final Collection<BaseClient> properties) {
    final Pac4jDelegatedAuthenticationProperties.Foursquare foursquare = pac4jProperties.getFoursquare();
    if (StringUtils.isNotBlank(foursquare.getId()) && StringUtils.isNotBlank(foursquare.getSecret())) {
        final FoursquareClient client = new FoursquareClient(foursquare.getId(), foursquare.getSecret());
        configureClient(client, foursquare);
        LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
        properties.add(client);
    }
}
Also used : FoursquareClient(org.pac4j.oauth.client.FoursquareClient) Pac4jDelegatedAuthenticationProperties(org.apereo.cas.configuration.model.support.pac4j.Pac4jDelegatedAuthenticationProperties)

Aggregations

FoursquareClient (org.pac4j.oauth.client.FoursquareClient)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