use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class SurrogateSelectionAction method doExecute.
@Override
protected Event doExecute(final RequestContext requestContext) {
final Credential credential = WebUtils.getCredential(requestContext);
if (credential instanceof UsernamePasswordCredential) {
final UsernamePasswordCredential upc = UsernamePasswordCredential.class.cast(credential);
final String target = requestContext.getExternalContext().getRequestParameterMap().get("surrogateTarget");
if (StringUtils.isNotBlank(target)) {
upc.setUsername(target + this.separator + upc.getUsername());
}
}
return success();
}
Aggregations