Facebook Login URL error using Asp.net - asp.net

When I try to log in to my application it returns the following error:
"Can not Load URL: The domain of this URL is not included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings."
How can I resolve this?

The error explains the issue itself. Whatever URL you are using to send the request and expect Facebook to redirect you after user logs in successfully needs to be mentioned in App Domains field in app settings.

Related

Email Link Password-Less Signin : 400 API key expired error on web browser

So I have email link signin (password less) working for iOS and Android, but if a user requests the email and then opens it on a web browser, they see this message:
Error encountered
{"error":{"code":400,"message":"API key expired. Please renew the API key.","errors":[{"message":"API key expired. Please renew the API key.","domain":"global","reason":"badRequest"}],"status":"INVALID_ARGUMENT"}}
I need them to click the link using their mobile device in order for the authentication to work, but ideally I could provide a more graceful message here that tells them to open the link on the mobile device. Any ideas?
I've now got this redirecting to my own website. Long story short - for some reason my Firebase hosting site was not configured properly and thus this authentication url was not being handled as it should. Fixable by recreating hosting site or just creating an additional site under hosting and using that for the email action url.
What I did was:
Create an Additional Site on Firebase Hosting. I made it additional so I wouldn't have to worry about messing with the Dynamic Link setup that is currently working on the default site.
Then under Authentication > Templates in the Firebase console, I changed the action url to use the new site but still have the (__/auth/action?...) path after the domain.
Now, when this url is accessed via a desktop browser, the user is redirected to the continue url (specified in the action code settings of the mobile app) and I display what I want on this continue url.
I noticed that in my Google API console, Firebase created a new Browser key and that it is being used whenever this auth link is clicked. Perhaps this was the issue all along. I wonder if I somehow restricted the wrong key. Anyways, if you run into a similar issue, check your API keys and their restrictions and/or just create a new additional site in Firebase hosting and use that.

Since I've activated the 'Strict Mode for Redirect URI', my Facebook Login is not working anymore

I have a chrome extension using Firebase that is running for years now.
Recently I have activated the 'Strict Mode for Redirect URI' in the Facebook Login option, and the Login is not working anymore.
I've copied the URI givent by Firebase in the 'Valid OAuth Redirect URIs' : https://safestkeys.firebaseapp.com/__/auth/handler
But this link doesn't pass the 'Redirect URI Validator' provided by Facebook...
When I try to log I get the following error messages:
Blocked URL: Redirection failed because the redirected URI is not trusted in
the application's OAuth Client settings. Make sure that the OAuth Client and Web ID are enabled and add the domains for all your applications to the list of allowed URIs.
Unable to load this URL: The domain of this URL is not registered in those of the application. To import this URL, add all the domains and subdomains of your application to the Domains field of the application settings.
I've also realized that even with these errors, the login actually works...

ASP.NET web api login with facebook stopped working

I am developing an ASP.net web app which uses Facebook authentication and up until August or September the Facebook login feature was working correctly.
I took a break from developing the app for a month or so, and recently resumed development. I tried it again recently to login to the app with Facebook, and I get this error message:
"URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs."
I haven't changed any code from my app since September or August, so something must have changed in the way Facebook processes its logins.
I have made changes to the Facebook app settings to try and fix this but nothing works.
My current settings look like this:
Client OAuth Login: Yes
Web OAuth Login: Yes
All the other settings under the Facebook Login product are set to No.
My current redirect URIs look like this:
https://myapp.azurewebsites.net/api/ExternalLogin/Facebook
https://myapp.azurewebsites.net/api/ExternalLogin/FacebookCallback
https://myapp.azurewebsites.net/api/signin-facebook
https://myapp.azurewebsites.net/api/ExternalLogin/Facebook/signin-facebook
Originally I only had the "/FacebookCallback" URI. I only added the others following suggestions from other questions here on Stack-overflow, but I am still getting the same error message.
Can anyone help me figure out what am I missing?
Please make sure:
Your App IDs and Secret Keys are correct. The App IDs and Secret Keys are all different for each app. These often cause the problem.
Your App domain set to:
myapp.azurewebsites.net
Your site URL set to:
http://myapp.azurewebsites.net/
You have set URI properly like:
http://myapp.azurewebsites.net/facebook/login/callback/
Update:
Make sure you have placed / at the end of your all URIs.
https://myapp.azurewebsites.net/api/ExternalLogin/Facebook/
https://myapp.azurewebsites.net/api/ExternalLogin/FacebookCallback/
https://myapp.azurewebsites.net/api/signin-facebook/
https://myapp.azurewebsites.net/api/ExternalLogin/Facebook/signin-facebook/
OR
localhost:44396/api/ExternalLogin/FacebookCallback/

Issue configuring Azure AD B2C with Asp.net Core 2 Web App

I have downloaded the sample code https://github.com/Azure-Samples/active-directory-b2c-dotnetcore-webapp/tree/core2.0
I have changed the appSettings.json file to use the values for my Tenant and Web Application.
However, when I try to login, I am redirected to the redirect URI that is setup in the policy I'm using.
I am really confused as to why it won't redirect to the default page for the SignIn-SignUp policy. Any ideas?
The SignIn-SignUp policy doesn't define the redirect URL. It you mean the Select reply URL when you test the policy on the Azure portal like figure below, it is defined in the app you register. And when you check the exact URL under Run now endpoint, you should also could see that the redirect URL is passed as the parameter redirect_uri just same as the web app do.

How to Login my ASP.NET MVC website through Facebook Login

I want to add facebook login button into my ASP.NET MVC website
and I am getting error:
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.
I assume you are going with the Server-Side Authentication route. This error means the domain of your redirect_url parameter is not listed in your Facebook App's "App Domains" list.
So either you entered redirect URL incorrectly in your OAuth dialog link, or the proper domain is not listed in your app's "App Domains" list. It is recommended you enter a wildcard domain in your app's App Domains list (e.g., example.com) so subdomains are included (e.g., www.example.com, blog.example.com)
You can view your Facebook App's App Domains by going to Settings -> Basic -> Basic Info.

Resources