*/
public static void redirectToOAuthProvider(HttpServletRequest req, HttpServletResponse resp, OAuthParams oauthParams) throws OAuthException {
try {
AuthenticationRequestBuilder requestBuilder = OAuthClientRequest.authorizationProvider(oauthParams.getProviderType()).setClientId(oauthParams.getClientKey()).setRedirectURI(oauthParams.getRedirectURI()).setResponseType(oauthParams.getResponseType()).setScope(oauthParams.getScope()).setState(oauthParams.getState());
oauthParams.addAdditionsParams(requestBuilder);
OAuthClientRequest request = requestBuilder.buildQueryMessage();
resp.sendRedirect(request.getLocationUri());
} catch (OAuthSystemException e) {
// Error building request
throw new OAuthException(e);
} catch (IOException e) {
// Error with sending redirect