Moved scope inside OAuthConfig

This commit is contained in:
Pablo Fernandez committed 2011-04-25 13:15:25 -03:00
1 parent 41b6da1a44
commit 109c93b4e4
11 files changed
+32 -76

No files matched your search

@@ -12,12 +12,10 @@ import org.scribe.model.*;
*/
public class OAuth10aServiceImpl implements OAuthService
{
private static final String NO_SCOPE = null;
private static final String VERSION = "1.0";
private OAuthConfig config;
private DefaultApi10a api;
private String scope;
/**
* Default constructor
@@ -29,7 +27,6 @@ public class OAuth10aServiceImpl implements OAuthService
{
this.api = api;
this.config = config;
this.scope = NO_SCOPE;
}
/**
@@ -52,7 +49,7 @@ public class OAuth10aServiceImpl implements OAuthService
request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, config.getApiKey());
request.addOAuthParameter(OAuthConstants.SIGN_METHOD, api.getSignatureService().getSignatureMethod());
request.addOAuthParameter(OAuthConstants.VERSION, getVersion());
if(scope != NO_SCOPE) request.addOAuthParameter(OAuthConstants.SCOPE, scope);
if(config.hasScope()) request.addOAuthParameter(OAuthConstants.SCOPE, config.getScope());
request.addOAuthParameter(OAuthConstants.SIGNATURE, getSignature(request, token));
}
@@ -88,14 +85,6 @@ public class OAuth10aServiceImpl implements OAuthService
return VERSION;
}
/**
* {@inheritDoc}
*/
public void addScope(String scope)
{
this.scope = scope;
}
/**
* {@inheritDoc}
*/