Created
March 13, 2018 14:52
-
-
Save phaelfp/885d16488ada2d62096ab5fe48a4f79a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.scribe.oauth; | |
import org.scribe.builder.api.DefaultApi10a; | |
import org.scribe.model.Token; | |
/* | |
* @author jerry | |
*/ | |
public final class MagentoThreeLeggedOAuth extends DefaultApi10a { | |
// NOTE as there is no central service for Magento, this does not suit Builder pattern. Must map to your store | |
private final String BASE_URL = "http://url.magento.com/index.php/"; | |
@Override | |
public String getRequestTokenEndpoint() { | |
return BASE_URL + "oauth/initiate"; | |
} | |
@Override | |
public String getAccessTokenEndpoint() { | |
return BASE_URL + "oauth/token"; | |
} | |
@Override | |
public String getAuthorizationUrl(Token requestToken) { | |
return BASE_URL + "webadmin/oauth_authorize?oauth_token=" + requestToken.getToken(); //this implementation is for admin roles only... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment