Skip to content

Commit

Permalink
Add method for signing an HttpUrlConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-livefront committed Feb 2, 2012
1 parent 9cb3214 commit fdf0f85
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.jeremyhaberman.restfulandroid.security;

import java.net.HttpURLConnection;

import org.apache.http.client.methods.HttpUriRequest;
import org.scribe.builder.ServiceBuilder;
import org.scribe.builder.api.TwitterApi;
import org.scribe.model.OAuthRequest;
Expand Down Expand Up @@ -236,6 +239,17 @@ public boolean loggedIn() {
public void signRequest(OAuthRequest request) {
mOAuthService.signRequest(getAccessToken(), request);
}

/**
* Signs an HttpUrlConnection
*
* @param conn
* the HttpURLConnectionto sign
*/
@Override
public void signConnection(HttpURLConnection conn) {
// TODO Jeremy implementing this
}

/**
* Log out of the application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.jeremyhaberman.restfulandroid.security;

import java.net.HttpURLConnection;

import org.scribe.model.OAuthRequest;

/**
Expand All @@ -17,5 +19,11 @@ interface RequestSigner {
* the request to sign
*/
public void signRequest(OAuthRequest request);

/**
* Adds the required OAuth information to an HttpUrlConnection
* @param conn
*/
public void signConnection(HttpURLConnection conn);

}

0 comments on commit fdf0f85

Please sign in to comment.