Facebook Login: "The application has disabled the Oauth client flow for Facebook integration"

Ranjeet SIngh picture Ranjeet SIngh · May 8, 2014 · Viewed 16.9k times · Source

I am doing Facebook login integration with my Android app. When I login it gives me the message that "Your application has disabled the Oauth client flow".

My code is like this:

package com.example.jiffy;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.widget.TextView;
import com.facebook.*;
import com.facebook.Session.NewPermissionsRequest;
import com.facebook.Session.OpenRequest;
import com.facebook.Session.StatusCallback;
import com.facebook.model.*;

public class JiffyFacebookLoginActivity extends Activity implements 

StatusCallback{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        OpenRequest open = new OpenRequest(this);
        open.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);
        open.setPermissions(Arrays.asList(new String[]{"email"}));
        open.setCallback(this);
        Session s = new Session(this);
        s.openForPublish(open);
    }

    @Override
    public void call(Session session, SessionState state, Exception 

exception) {
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent 

data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(Session.getActiveSession()!=null)
            Session.getActiveSession().onActivityResult(this, requestCode, 

resultCode, data);
    }
}

I have no idea how to correct this.

Answer

Owen Cao picture Owen Cao · May 9, 2014

You need to enable Client OAuth Login in your Facebook App Settings.
The motivation disable any authentication flows that the app does not use is to minimize attack surface area. When you need to use it, you need enable it.

enter image description here

Get more details from here.