Search in sources :

Example 1 with DropBoxClient

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

the class DelegatedClientFactory method configureDropboxClient.

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

Example 2 with DropBoxClient

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

the class DefaultDelegatedClientFactory method configureDropBoxClient.

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

Example 3 with DropBoxClient

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

the class Pac4jAuthenticationEventExecutionPlanConfiguration method configureDropboxClient.

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

Example 4 with DropBoxClient

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

the class RunDropboxClient method getClient.

@Override
protected IndirectClient getClient() {
    final DropBoxClient dropBoxClient = new DropBoxClient();
    dropBoxClient.setKey("0194c6m79qll0ia");
    dropBoxClient.setSecret("a0ylze9a0bhsvxv");
    dropBoxClient.setCallbackUrl("https://www.google.com");
    return dropBoxClient;
}
Also used : DropBoxClient(org.pac4j.oauth.client.DropBoxClient)

Aggregations

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