private void sendOAuthHTTPRequest(String serviceName, String accessToken, String credentialToken, Response.Listener listener) {
        RequestQueue queue = Volley.newRequestQueue(mContext);
        String url = "http://" + getServerHostname() + ":" + getServerPort() + "/_oauth/" + serviceName + "/";
        //as far as I know, Facebook is the only one that only returns a long-lived token on mobile login
        String params;
        if (accessTokenServices.contains(serviceName)) {
            params = "?accessToken=" + accessToken + "&state=" + generateState(credentialToken);
        } else {
            params = "?code=" + accessToken + "&state=" + generateState(credentialToken);
        }

        StringRequest request = new StringRequest(Request.Method.GET, url + params,
                listener, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                error.printStackTrace();
                if (BuildConfig.DEBUG) {
                    log.debug("If you're getting a weird error, " +
                            "this could be because you haven't configured " +
                            "your server for ddp loginWithOAuth yet. " +
                            "For Facebook login, remove accounts-facebook " +
                            "and add jasperlu:accounts-facebook-ddp instead.");
                }
            }
        });

        queue.add(request);
    }
private void sendOAuthHTTPRequest ( String serviceName , String accessToken , String credentialToken , Response . Listener listener ) { RequestQueue queue = Volley . newRequestQueue ( mContext ) ; String url = "http://" + getServerHostname ( ) + ":" + getServerPort ( ) + "/_oauth/" + serviceName + "/" ; String params ; if ( accessTokenServices . contains ( serviceName ) ) { params = "?accessToken=" + accessToken + "&state=" + generateState ( credentialToken ) ; } else { params = "?code=" + accessToken + "&state=" + generateState ( credentialToken ) ; } StringRequest request = new StringRequest ( Request . Method . GET , url + params , listener , new Response . ErrorListener ( ) { @ Override public void onErrorResponse ( VolleyError error ) { error . printStackTrace ( ) ; if ( BuildConfig . DEBUG ) { log . debug ( "If you're getting a weird error, " + "this could be because you haven't configured " + "your server for ddp loginWithOAuth yet. " + "For Facebook login, remove accounts-facebook " + "and add jasperlu:accounts-facebook-ddp instead." ) ; } } } ) ; queue . add ( request ) ; }
/*
Login with OAuth requires the priming of "pending credentials" on the server to receive a secret