String message = i18n.tr("OAuth error encountered. Internal message is: {0}",
e.getMessage());
throw new BadRequestException(message);
}
catch (URISyntaxException e) {
throw new IseException(e.getMessage(), e);
}
catch (IOException e) {
throw new IseException(e.getMessage(), e);
}
return principal;
}