use of org.pac4j.oauth.client.Google2Client in project cas by apereo.
the class Pac4jAuthenticationEventExecutionPlanConfiguration method configureGoogleClient.
private void configureGoogleClient(final Collection<BaseClient> properties) {
final Pac4jProperties.Google google = casProperties.getAuthn().getPac4j().getGoogle();
final Google2Client client = new Google2Client(google.getId(), google.getSecret());
if (StringUtils.isNotBlank(google.getId()) && StringUtils.isNotBlank(google.getSecret())) {
if (StringUtils.isNotBlank(google.getScope())) {
client.setScope(Google2Client.Google2Scope.valueOf(google.getScope().toUpperCase()));
}
properties.add(client);
}
}
use of org.pac4j.oauth.client.Google2Client in project cas by apereo.
the class DelegatedClientFactory method configureGoogleClient.
/**
* Configure google client.
*
* @param properties the properties
*/
protected void configureGoogleClient(final Collection<BaseClient> properties) {
final Pac4jDelegatedAuthenticationProperties.Google google = pac4jProperties.getGoogle();
final Google2Client client = new Google2Client(google.getId(), google.getSecret());
if (StringUtils.isNotBlank(google.getId()) && StringUtils.isNotBlank(google.getSecret())) {
configureClient(client, google);
if (StringUtils.isNotBlank(google.getScope())) {
client.setScope(Google2Client.Google2Scope.valueOf(google.getScope().toUpperCase()));
}
LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
properties.add(client);
}
}
use of org.pac4j.oauth.client.Google2Client in project pac4j by pac4j.
the class RunGoogle2Client method getClient.
@Override
protected IndirectClient getClient() {
final Google2Client google2Client = new Google2Client();
google2Client.setKey("682158564078-ndcjc83kp5v7vudikqu1fudtkcs2odeb.apps.googleusercontent.com");
google2Client.setSecret("gLB2U7LPYBFTxqYtyG81AhLH");
google2Client.setCallbackUrl(PAC4J_BASE_URL);
google2Client.setScope(Google2Client.Google2Scope.EMAIL_AND_PROFILE);
return google2Client;
}
use of org.pac4j.oauth.client.Google2Client in project cas by apereo.
the class DefaultDelegatedClientFactory method configureGoogleClient.
/**
* Configure google client.
*
* @param properties the properties
*/
protected void configureGoogleClient(final Collection<IndirectClient> properties) {
val pac4jProperties = casProperties.getAuthn().getPac4j();
val google = pac4jProperties.getGoogle();
if (google.isEnabled() && StringUtils.isNotBlank(google.getId()) && StringUtils.isNotBlank(google.getSecret())) {
val client = new Google2Client(google.getId(), google.getSecret());
configureClient(client, google);
if (StringUtils.isNotBlank(google.getScope())) {
client.setScope(Google2Client.Google2Scope.valueOf(google.getScope().toUpperCase()));
}
LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
properties.add(client);
}
}
Aggregations