Skip to content

Instantly share code, notes, and snippets.

@smiklosovic
Created October 8, 2013 16:07
Show Gist options
  • Save smiklosovic/6887115 to your computer and use it in GitHub Desktop.
Save smiklosovic/6887115 to your computer and use it in GitHub Desktop.
public void retrieveOTPPath(FragmentActivity activity, Callback<List<OTP>> callback) throws Exception {
AuthenticationModule authModule = authenticator.get("login", activity);
URL url = new URL(baseURL);
Pipeline pipeline = new Pipeline(url);
PipeConfig pipeConfig = new PipeConfig(url, OTP.class);
pipeConfig.setAuthModule(authModule);
pipeConfig.setEndpoint("/auth/otp/secret");
Pipe<OTP> pipe = pipeline.pipe(OTP.class, pipeConfig);
ReadFilter filter = new ReadFilter();
filter.setLinkUri(new URI("/aerogear-controller-demo/auth/otp/secret"));
pipe.read(filter, callback);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment