use of org.pac4j.scribe.builder.api.GenericApi20 in project pac4j by pac4j.
the class GenericOAuth20Client method clientInit.
@Override
protected void clientInit() {
LOG.info("InternalInit");
GenericApi20 genApi = new GenericApi20(authUrl, tokenUrl);
configuration.setApi(genApi);
configuration.setCustomParams(customParams);
GenericOAuth20ProfileDefinition profileDefinition = new GenericOAuth20ProfileDefinition();
profileDefinition.setFirstNodePath(profilePath);
profileDefinition.setProfileVerb(profileVerb);
profileDefinition.setProfileUrl(profileUrl);
if (profileAttrs != null) {
for (Map.Entry<String, String> entry : profileAttrs.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
String[] tokens = value.split("\\|");
if (tokens.length == 2) {
profileDefinition.profileAttribute(key, tokens[1], getConverter(tokens[0]));
} else if (tokens.length == 1) {
profileDefinition.profileAttribute(key, value, null);
} else {
LOG.warning("Ignored incorrect attribute value expressions:" + value);
}
}
}
configuration.setProfileDefinition(profileDefinition);
super.clientInit();
}
Aggregations