code: public String getAuthorizationUri(List<Scope> scopes, String redirectUri, String state, String userName, String userEmail) {
  		// this method must use www instead of just naked domain for security reasons.
  		String host = key.isProduction() ? "https://www.wepay.com" : "https://stage.wepay.com";
  		String uri = host + "/v2/oauth2/authorize?";
  
  		uri += "client_id=" +  urlEncode(key.getClientId()) + "&";
  		uri += "redirect_uri=" +  urlEncode(redirectUri) + "&";
  		uri += "scope=" + urlEncode(StringUtils.join(scopes, ","));
  		if (state != null || userName != null || userEmail != null)
  			uri += "&";
  		uri += state != null ? "state=" +  urlEncode(state) + "&" : "";
  		uri += userName != null ? "user_name=" +  urlEncode(userName) + "&" : "";
  		uri += userEmail != null ? "user_email=" +  urlEncode(userEmail) : "";
  
  		return uri;
  	}
docs: Generate URI used during oAuth authorization
  Redirect your user to this URI where they can grant your application
  permission to make API calls
  @see <a href="https://www.wepay.com/developer/reference/oauth2">https://www.wepay.com/developer/reference/oauth2</a>
  @param scopes             List of scope fields for which your application wants access
  @param redirectUri      Where user goes after logging in at WePay (domain must match application settings)
  @param userName  user_name,user_email which will be pre-filled on login form, state to be returned in querystring of redirect_uri
  @return string URI to which you must redirect your user to grant access to your application