public String getRequestAccessUrl(String approvalPrompt, boolean viewPrivate, boolean write, String state)
    {
        String url = "https://www.strava.com/oauth/authorize?client_id=" + clientId + "&response_type=code&redirect_uri=" + redirectUri;

        StringBuilder sb = new StringBuilder(url);

        if (viewPrivate || write)
        {
            sb.append("&scope=");

            if (viewPrivate) {
                sb.append("view_private");
            }
            if (viewPrivate && write) {
                sb.append(",");
            }
            if (write) {
                sb.append("write");
            }
        }
        sb.append("&state=" + state);
        if (!approvalPrompt.equals("force") && !approvalPrompt.equals("auto")) {
            throw new IllegalArgumentException("approvalPrompt should be 'force' or 'auto'");
        }
        sb.append("&approval_prompt=" + approvalPrompt);

        return sb.toString();
    }