You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by cl...@gmail.com on 2012/06/15 17:09:37 UTC
SHINIG-1801 OAuth2Accessor lookup for shared tokens (issue 6303083)
Reviewers: btlillie, Stanton, dev_shindig.apache.org,
Description:
For the shared token optin works better if the gadgets also share an
OAuth2Accessor. Simple fix to rewrite the gadgetUri for accessors the
same way we do for tokens.
Please review this at http://codereview.appspot.com/6303083/
Affected files:
java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth2/BasicOAuth2Store.java
Index:
java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth2/BasicOAuth2Store.java
===================================================================
---
java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth2/BasicOAuth2Store.java
(revision 1350211)
+++
java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth2/BasicOAuth2Store.java
(working copy)
@@ -179,8 +179,10 @@
gadgetUri, serviceName, user, scope });
}
+ final String gadgetUri1 = this.getGadgetUri(gadgetUri, serviceName);
+
final OAuth2CallbackState state = new
OAuth2CallbackState(this.stateCrypter);
- state.setGadgetUri(gadgetUri);
+ state.setGadgetUri(gadgetUri1);
state.setServiceName(serviceName);
state.setUser(user);
state.setScope(scope);
@@ -196,7 +198,7 @@
final OAuth2Token refreshToken = this.getToken(gadgetUri,
serviceName, user, scope,
OAuth2Token.Type.REFRESH);
- final BasicOAuth2Accessor newAccessor = new
BasicOAuth2Accessor(gadgetUri, serviceName,
+ final BasicOAuth2Accessor newAccessor = new
BasicOAuth2Accessor(gadgetUri1, serviceName,
user, scope, client.isAllowModuleOverride(), this,
this.globalRedirectUri,
this.authority, this.contextRoot);
newAccessor.setAccessToken(accessToken);