|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fitbit.api.client.http.OAuth
public class OAuth
Constructor Summary | |
---|---|
OAuth(String consumerKey,
String consumerSecret)
|
Method Summary | |
---|---|
static String |
constructRequestURL(String url)
The Signature Base String includes the request absolute URL, tying the signature to a specific endpoint. |
static String |
encode(String value)
|
static String |
encodeParameters(List<PostParameter> postParams)
|
static String |
encodeParameters(List<PostParameter> postParams,
String splitter,
boolean quot)
|
boolean |
equals(Object o)
|
String |
generateSignature(String data)
|
String |
generateSignature(String data,
com.fitbit.api.client.http.OAuthToken token)
Computes RFC 2104-compliant HMAC signature. |
int |
hashCode()
|
static String |
normalizeAuthorizationHeaders(List<PostParameter> params)
|
static String |
normalizeRequestParameters(List<PostParameter> params)
|
static String |
normalizeRequestParameters(PostParameter[] params)
The request parameters are collected, sorted and concatenated into a normalized string: • Parameters in the OAuth HTTP Authorization header excluding the realm parameter. • Parameters in the HTTP POST request body (with a content-type of application/x-www-form-urlencoded). • HTTP GET parameters added to the URLs in the query part (as defined by [RFC3986] section 3). The oauth_signature parameter MUST be excluded. The parameters are normalized into a single string as follows: 1. |
void |
setConsumerKey(String consumerKey)
|
void |
setConsumerSecret(String consumerSecret)
|
static List<PostParameter> |
toParamList(PostParameter[] params)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OAuth(String consumerKey, String consumerSecret)
Method Detail |
---|
public String generateSignature(String data, com.fitbit.api.client.http.OAuthToken token)
data
- the data to be signed
public String generateSignature(String data)
public static String normalizeRequestParameters(PostParameter[] params)
params
- parameters to be normalized and concatenated
public static String normalizeRequestParameters(List<PostParameter> params)
public static String normalizeAuthorizationHeaders(List<PostParameter> params)
public static List<PostParameter> toParamList(PostParameter[] params)
public static String encodeParameters(List<PostParameter> postParams)
postParams
- parameters to be enocded and concatenated
public static String encodeParameters(List<PostParameter> postParams, String splitter, boolean quot)
public static String encode(String value)
value
- string to be encoded
public static String constructRequestURL(String url)
url
- the url to be normalized
public void setConsumerKey(String consumerKey)
public void setConsumerSecret(String consumerSecret)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |