Skip to content

Commit

Permalink
0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
adrielcafe committed Jul 4, 2016
1 parent 867dd76 commit 8be5ceb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void facebookLogin(View v){
FacebookOAuth.Builder(this)
.setClientId(Credentials.FACEBOOK_APP_ID)
.setClientSecret(Credentials.FACEBOOK_APP_SECRET)
.setCallback(Credentials.FACEBOOK_REDIRECT_URI)
.setRedirectUri(Credentials.FACEBOOK_REDIRECT_URI)
.setTokenCallback(new OnGetTokenCallback() {
@Override
public void onSuccess(String token, SocialUser account) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class BaseOAuth {
protected String clientId;
protected String clientSecret;
protected String scope;
protected String callback;
protected String redirectUri;
protected String getAccountUrl;
protected DefaultApi20 api;
protected OnGetTokenCallback tokenCallback;
Expand All @@ -45,8 +45,8 @@ public BaseOAuth setClientSecret(String clientSecret){
return this;
}

public BaseOAuth setCallback(String callback){
this.callback = callback;
public BaseOAuth setRedirectUri(String redirectUri){
this.redirectUri = redirectUri;
return this;
}

Expand All @@ -62,7 +62,7 @@ public void login(){
.apiSecret(clientSecret)
.state(state)
.scope(scope)
.callback(callback)
.callback(redirectUri)
.build(api);
final String authUrl = service.getAuthorizationUrl();
ConsentDialog.newInstance(authUrl, state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@

public final class GoogleOAuth extends BaseOAuth {
private static final String SCOPE = "profile email";
private static final String CALLBACK = "urn:ietf:wg:oauth:2.0:oob:auto";
private static final String REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob:auto";
private static final String GET_ACCOUNT_URL = "https://www.googleapis.com/plus/v1/people/me";

private GoogleOAuth(Activity activity){
super(activity, GoogleApi20.instance(), SCOPE, GET_ACCOUNT_URL);
callback = CALLBACK;
redirectUri = REDIRECT_URI;
}

public static GoogleOAuth Builder(Activity activity){
return new GoogleOAuth(activity);
}

@Override
public BaseOAuth setCallback(String callback){
throw new IllegalArgumentException("Must use the default Google url callback");
public BaseOAuth setRedirectUri(String callback){
throw new IllegalArgumentException("Must use the default Google url redirect");
}

@Override
Expand Down

0 comments on commit 8be5ceb

Please sign in to comment.