I am developing a captive portal implementation that will use facebook to authenticate users. The users will have to be able to login to facebook to get authenticated and access the internet freely. Unless the user authenticates, they must not be able to freely browse facebook (or any other website). I am using javascript sdk.
I am having trouble with this flow on iOS devices. iOS devices when connect to ssid bring up pseudo browser that does not have cookies and sessions. On this page the user can click "Connect via Facebook". This will bring up oauth login dialog. Following is code snippet of how this is acheived: document.location = "https://www.facebook.com/dialog/oauth?client_id=" + WF_FB_APP_ID + "&response_type=token&scope=public_profile,email,user_birthday&redirect_uri=" + encodeURIComponent(document.location.href);
When the user enters email and password, instead of authenticating the user, facebook returns some error code:200, error description "Permissions error" and error reason "User denied" and redirects to safari where the user is required to enter the credentials again. At this point, entering the same credentials works fine and user gets access to the internet.
I would like to know why do the creds not work the first time and why is there redirection to safari. Andriod and windows devices do not have this problem since the user is required to open browser and login process through facebook works fine in the browser.
Are there any suggestions that I can try? I am using Meraki AP in the cloud and have put all possible facebook domains in the walled garden entry. I have tried googling this scenario but no avail. Any help or suggestion to try would be much appreciated.