Permalink
Browse files

Merge pull request #298 from bubuntux/ubuntuOne

Add support for Ubutun One
  • Loading branch information...
2 parents bf4f0db + 417d2e7 commit 517d3f6b21093d74eb5273488673efeacd5b6b69 @fernandezpablo85 fernandezpablo85 committed Sep 13, 2012
@@ -0,0 +1,40 @@
+package org.scribe.builder.api;
+
+import org.scribe.model.Token;
+import org.scribe.services.*;
+
+/**
+ * @author Julio Gutierrez
+ *
+ * Sep 6, 2012
+ */
+public class UbuntuOneApi extends DefaultApi10a
+{
+
+ private static final String AUTHORIZATION_URL = "https://one.ubuntu.com/oauth/authorize/?oauth_token=%s";
+
+ @Override
+ public String getAccessTokenEndpoint()
+ {
+ return "https://one.ubuntu.com/oauth/access/";
+ }
+
+ @Override
+ public String getAuthorizationUrl(Token requestToken)
+ {
+ return String.format(AUTHORIZATION_URL, requestToken.getToken());
+ }
+
+ @Override
+ public String getRequestTokenEndpoint()
+ {
+ return "https://one.ubuntu.com/oauth/request/";
+ }
+
+ @Override
+ public SignatureService getSignatureService()
+ {
+ return new PlaintextSignatureService();
+ }
+
+}
@@ -11,7 +11,7 @@
*/
public class PlaintextSignatureService implements SignatureService
{
- private static final String METHOD = "plaintext";
+ private static final String METHOD = "PLAINTEXT";
/**
* {@inheritDoc}

0 comments on commit 517d3f6

Please sign in to comment.