Search in sources :

Example 1 with WordPressClient

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

the class Pac4jAuthenticationEventExecutionPlanConfiguration method configureWordpressClient.

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

Example 2 with WordPressClient

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

the class DelegatedClientFactory method configureWordpressClient.

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

Example 3 with WordPressClient

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

the class RunWordPressClient method getClient.

@Override
protected IndirectClient getClient() {
    final WordPressClient wordPressClient = new WordPressClient();
    wordPressClient.setKey("209");
    wordPressClient.setSecret("xJBXMRVvKrvHqyvM6BpzkenJVMIdQrIWKjPJsezjGYu71y7sDgt8ibz6s9IFLqU8");
    wordPressClient.setCallbackUrl(PAC4J_URL);
    return wordPressClient;
}
Also used : WordPressClient(org.pac4j.oauth.client.WordPressClient)

Example 4 with WordPressClient

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

the class DefaultDelegatedClientFactory method configureWordPressClient.

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

Aggregations

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