if (pathInfo.startsWith("/oauth")) {
String oauthParam = req.getParameter(OAuthHelper.OAUTH);
if(oauthParam != null){
OAuthHelper.redirectToOAuthProvider(req, resp, getOAuthParams(req, oauthParam, login));
}else {
OAuthConsumer oauthConsumer = OAuthHelper.handleOAuthReturnAndTokenAccess(req, resp, getOAuthParams());
if(login)
OAuthHelper.handleLogin(req, resp, oauthConsumer);
else
OAuthHelper.handleReturnAndLinkAccount(req, resp, oauthConsumer);
}