Home | History | Annotate | Download | only in oauth

Lines Matching defs:oauth

17 package net.oauth;
33 import net.oauth.http.HttpMessage;
34 import net.oauth.signature.OAuthSignatureMethod;
37 * A request or response message used in the OAuth protocol.
58 this.parameters.add(new OAuth.Parameter(
97 addParameter(new OAuth.Parameter(key, value));
116 return getParameter(OAuth.OAUTH_CONSUMER_KEY);
120 return getParameter(OAuth.OAUTH_TOKEN);
124 return getParameter(OAuth.OAUTH_SIGNATURE_METHOD);
128 return getParameter(OAuth.OAUTH_SIGNATURE);
134 parameterMap = OAuth.newMap(parameters);
240 OAuthProblemException problem = new OAuthProblemException(OAuth.Problems.PARAMETER_ABSENT);
241 problem.setParameter(OAuth.Problems.OAUTH_PARAMETERS_ABSENT, OAuth.percentEncode(absent));
255 final Map<String, String> pMap = OAuth.newMap(parameters);
256 if (pMap.get(OAuth.OAUTH_TOKEN) == null && accessor.accessToken != null) {
257 addParameter(OAuth.OAUTH_TOKEN, accessor.accessToken);
260 if (pMap.get(OAuth.OAUTH_CONSUMER_KEY) == null) {
261 addParameter(OAuth.OAUTH_CONSUMER_KEY, consumer.consumerKey);
263 String signatureMethod = pMap.get(OAuth.OAUTH_SIGNATURE_METHOD);
265 signatureMethod = (String) consumer.getProperty(OAuth.OAUTH_SIGNATURE_METHOD);
267 signatureMethod = OAuth.HMAC_SHA1;
269 addParameter(OAuth.OAUTH_SIGNATURE_METHOD, signatureMethod);
271 if (pMap.get(OAuth.OAUTH_TIMESTAMP) == null) {
272 addParameter(OAuth.OAUTH_TIMESTAMP, (System.currentTimeMillis() / 1000) + "");
274 if (pMap.get(OAuth.OAUTH_NONCE) == null) {
275 addParameter(OAuth.OAUTH_NONCE, System.nanoTime() + "");
277 if (pMap.get(OAuth.OAUTH_VERSION) == null) {
278 addParameter(OAuth.OAUTH_VERSION, OAuth.VERSION_1_0);
314 into.append(" realm=\"").append(OAuth.percentEncode(realm)).append('"');
323 into.append(OAuth.percentEncode(name)).append("=\"");
324 into.append(OAuth.percentEncode(toString(parameter.getValue()))).append('"');
356 * Parse the parameters from an OAuth Authorization or WWW-Authenticate
358 * start with "OAuth ", return an empty list.
360 public static List<OAuth.Parameter> decodeAuthorization(String authorization) {
361 List<OAuth.Parameter> into = new ArrayList<OAuth.Parameter>();
369 String name = OAuth.decodePercent(m.group(1));
370 String value = OAuth.decodePercent(m.group(2));
371 into.add(new OAuth.Parameter(name, value));
380 public static final String AUTH_SCHEME = "OAuth";