Answered by:
Facebook authentication with Azure Mobile Services - Xamarin.iOS

Question
-
I am trying to get facebook authentication working for an example. I have a mobile services client setup with my url and my application key. I create a MobileServiceClient in my AppDelegate. I have saved data before when I have the data only needing to be authenticated. I have then added my app id and my app secret to my mobile service's identity facebook settings. I have gone into the mobile services's table permissions and changed all of the permissions to only allow for the "Only Authenticated Users" in the CRUD operations. Finally, in my app, I have a login button that will call the client's .LoginAsync method handing in the current viewcontroller and the enum value of MobileSerivceAuthenticationProvider.Facebook. When I start my app up and select the login button, a web page pops up, and and error is generated. The error message is: Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
1. Does this error mean anything specific that anyone is aware of? Any specific suggestions?
2. Does the error possibly mean that the app is not configured properly in facebook app settings? I have the basic setting setup and I have turned on that this is a "native or desktop app," unfortunately, this did not change anything. Any suggestions regarding facebook settings?
3. Any other ideas?
Wally
MVP in ASP.NET - ASPInsider - Author - Otherwise I am a loser.
Friday, February 7, 2014 5:46 PM
Answers
-
If you're using the web view to login, you don't want to select the "Native or desktop app". Instead you want to refer to the app as a Website with Facebook Login as seen here:
- Proposed as answer by Jonathon Deriso Friday, February 7, 2014 7:10 PM
- Marked as answer by Wally McClure Friday, February 7, 2014 7:54 PM
Friday, February 7, 2014 6:40 PM -
This link explains as mentioned above: http://www.windowsazure.com/en-us/documentation/articles/mobile-services-how-to-register-facebook-authentication/. The mobile service is authenticating for you so it needs to be configured for Website with Facebook Login with your mobile service URL.
- Marked as answer by Wally McClure Friday, February 7, 2014 7:54 PM
Friday, February 7, 2014 6:51 PM
All replies
-
If you're using the web view to login, you don't want to select the "Native or desktop app". Instead you want to refer to the app as a Website with Facebook Login as seen here:
- Proposed as answer by Jonathon Deriso Friday, February 7, 2014 7:10 PM
- Marked as answer by Wally McClure Friday, February 7, 2014 7:54 PM
Friday, February 7, 2014 6:40 PM -
This link explains as mentioned above: http://www.windowsazure.com/en-us/documentation/articles/mobile-services-how-to-register-facebook-authentication/. The mobile service is authenticating for you so it needs to be configured for Website with Facebook Login with your mobile service URL.
- Marked as answer by Wally McClure Friday, February 7, 2014 7:54 PM
Friday, February 7, 2014 6:51 PM -
Thanks Jonathan and Chris. You feedback/answers are greatly appreciated!!!!!
The issue was that I had not set my azure site as my site url. That was the biggie. I also went back and turned the "Using Native or Desktop" setting to off. Doing both together have resolved my issue with facebook. Thanks so much for looking at this.
Wally
MVP in ASP.NET - ASPInsider - Author - Otherwise I am a loser.
Friday, February 7, 2014 7:54 PM