code: private String buildAuthUrl(String baseAuthUrl, GrantType grantType, OAuth2Parameters parameters) {
  		StringBuilder authUrl = new StringBuilder(baseAuthUrl);
  		if (grantType == GrantType.AUTHORIZATION_CODE) {
  			authUrl.append('&').append("response_type").append('=').append("code");
  		} else if (grantType == GrantType.IMPLICIT_GRANT) {
  			authUrl.append('&').append("response_type").append('=').append("token");
  		}
  		for (Iterator<Entry<String, List<String>>> additionalParams = parameters.entrySet().iterator(); additionalParams.hasNext();) {
  			Entry<String, List<String>> param = additionalParams.next();
  			String name = formEncode(param.getKey());
  			for (Iterator<String> values = param.getValue().iterator(); values.hasNext();) {
  				authUrl.append('&').append(name);
  				String value = values.next();
  				if (StringUtils.hasLength(value)) {
  					authUrl.append('=').append(formEncode(value));
  				}
  			}
  		}
  		return authUrl.toString();		
  	}
docs: internal helpers