Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Scope shouldnt default to email, it should default to nothing

  • Loading branch information...
commit 287947add281a313e3d92f3189d2120ab9c37bbf 1 parent 4999e75
@murz authored
View
2  README.md
@@ -50,7 +50,7 @@ The tag takes three optional parameters.
- `label` which defaults to *Sign in with Facebook*
- `cssClass` which defaults to *play-fbconnect-button*
-- `scope` which defaults to *email* (see [the facebook docs](http://developers.facebook.com/docs/authentication/permissions) for possible values of scope)
+- `scope` which is excluded by default (see [the facebook docs](http://developers.facebook.com/docs/authentication/permissions) for possible values of scope)
### Define your OAuth callback
View
2  documentation/manual/home.textile
@@ -48,7 +48,7 @@ bc. #{fbconnect.button label:'Login using your facebook account.' /}
* @label@ which defaults to *Sign in with Facebook*
* @cssClass@ which defaults to *play-fbconnect-button*
-* @scope@ which defaults to *email* (see "this table":http://developers.facebook.com/docs/authentication/permissions for possible values of scope)
+* @scope@ which is excluded by default (see "this table":http://developers.facebook.com/docs/authentication/permissions for possible values of scope)
h3. Define your OAuth callback
View
6 src/play/modules/fbconnect/FBConnectSession.java
@@ -37,7 +37,11 @@ public String getLoginUrl() {
}
public String getLoginUrl(String scope){
- return String.format("https://www.facebook.com/dialog/oauth?client_id=%s&display=%s&redirect_uri=%s&scope=%s", WS.encode(id), WS.encode("page"), WS.encode(Router.getFullUrl("FBConnect.callback")), scope);
+ String url = String.format("https://www.facebook.com/dialog/oauth?client_id=%s&display=%s&redirect_uri=%s", WS.encode(id), WS.encode("page"), WS.encode(Router.getFullUrl("FBConnect.callback")));
+ if(scope != null){
+ url += "&scope="+WS.encode(scope);
+ }
+ return url;
}
public String getAuthUrl(String authCode){
Please sign in to comment.
Something went wrong with that request. Please try again.