Error when signing up via Facebook

I get a strange error when signing up the user via Facebook:

state=applicationState&error=access_denied&error_description=User+is+not+assigned+to+the+client+application.#=

At the same time, the user is actually created, I can see it in the dashboard, also it is authenticated to the user dashboard.

I want the user to be automatically assigned to the group which is assigned to my application, which was used to initiate the login process.

How can I do that?