cannot load url error in facebook login using node in localhost - node.js

I know there are lot of posts and blogs regarding this error but most of the answers were related to the wrong url in the OAuth Redirect URIs and have tried all of them.
Currently I trying to login with facebook on my localhost only.
any help would be appreciated as I am struck here for a long time.

finally i was able to resolve it. I added the test app by clicking on the option button of the my app and then creating test app for it.

In oauth2 (google, facebook, linkedin, etc) there are 2 parameters that need to be configured:
domain or origin
redirect or callback
In Facebook App Settings we have:
App Domain (Your problem)
sample: acme.com
The domain should be without "https" or "www" or "subdomain":
Site URL
sample: http://acme.com/
OAuth redirect URI
sample: http://acme.com/auth/facebook/callback
/auth/facebook/callback must be a route in your nodejs express.
Advice
Review char by char the explained values in your facebook configuration page.
Source
https://help.sharetribe.com/en/articles/1317484-how-to-solve-the-can-t-load-url-the-domain-of-this-url-isn-t-included-in-the-app-s-domains-facebook-login-error
Facebook OAuth "The domain of this URL isn't included in the app's domain"

Related

Google OAuth 2 authorization - wrong confiemation link is generated

Trying to allow my application to read my gmail.
Created OAuth 2.0 client, set up redirect urls for it.
Started service and got prompt
Please visit this URL to authorize this application:
But this url has incorrect redirect_url param (it sets localhost:xxxxx where port is always a random number). This URL is not what I set up creating OAuth client (my redirect uris are on the same host as my application). So I can't authenticate my service to my gmail. Why?
Should the redirect uri return smth? I've read all the related questions, but can't find an answer.

"AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application" when signing in

I'm trying to follow this tutorial to create an app that uses the Microsoft Graph API, and I'm getting the following error when I click the "sign in with Microsoft" button:
AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: (the guid that is my application ID)
I added several URLs to the list of redirect URLs for my app at the Azure app configuration portal - one for another web app I want to eventually integrate this with (http://localhost:31503), one that was listed in the tutorial (http://localhost:44368), and the one that IIS Express is running the tutorial app as (http://localhost:7360). Even after adding all these URLs, though, I still get this error - what could be going on? Why can't I sign in?
There is a mistake in this tutorial. You should add https://localhost:44368/ on Azure portal, not http://localhost:44368/.
By the way, for the mismatch issue, there is a common solution. Just like #Marc said, you can track the auth request url to find the redirect_uri parameter. The request url is something like
https://login.microsoftonline.com/{tenant}/oauth2/authorize? client_id=6731de76-14a6-49ae-97bc-6eba6914391e &response_type=code &redirect_uri=http%3A%2F%2Flocalhost%3A12345 &response_mode=query &resource=https%3A%2F%2Fservice.contoso.com%2F &state=12345
After clicking sign in button and before inputting the account, you will find the request url.
Just look at the url your application is sending to AAD to request login. It will include url encoded reply_url parameter. Decode it and make sure your application is registered with exactly the same url: same casing, no extra/missing trailing slashes.

How can I get the Pinterest API to accept my redirect URL?

I am trying to build an app in node.js that connects to Pinterest via its API. I can get an access token via Postman and test my app in single-user mode, but I am unable to incorporate OAuth2 to test my app for a second user. Every configuration of my code and settings at developer.pinterest.com yields the error "The provided redirect_uri ... does not match any of my registered redirect URIs."
I registered what I believe are correct callback URLs at developers.pinterest.com--many variants, with and without trailing slashes. My callback is hosted via https.
I tried calling Pinterest's auth URLs OAuth2 in my server code (node.js), and via browser address bar.
https://api.pinterest.com/oauth/?response_type=code&redirect_uri=https://www.outfinterest.com/auth/pinterest/callback/&client_id=5042375080944909391&scope=read_public&state=true
I attempted the auth from a browser logged into Pinterest as me, and from a browser logged in as a registered tester of my app.
What must I do to get Pinterest to accept my callback URL?
Do I need to submit my app for approval before I can authorize via OAuth2?
I resolved the problem by reducing the set URLs registered at developer.pinterest.com to just the one I need, then reloaded the page with the app settings.

Google API using Oauth for internal company use only

I've created a web application using Node.js that relies on a google API (specifically the DCM/DFA reporting API). It redirects the user to login to their gmail account, and after a successful login redirects back to the web application.
Suddenly my company has told me that this web application needs to be restricted to internal use only, and that they won't host it on a public domain for security reasons.
Is there any way to get Oauth to redirect to the internal domain? When I try to set the redirect domain in the google developers console I get an error message that it is not valid. Is there anyway around this?
The sample redirect url you can add at Console and Code is:
http://localhost:8080/authcallback
(Remember to not add trailing / in url)

using Azure Mobile App for Google authentication

I follow this tutorial for Google authentication for my web application.
I specified the following in my Google Developers Console:
Authorized JavaScript origins = my Azure mobile app url
Authorized redirect URIs = my web app url + /.auth/login/google/callback
But in this case I get the following error:
That’s an error.
Error: redirect_uri_mismatch
The redirect URI in the request:
mobile app url + .auth/login/google/callback did
not match a registered redirect URI.
If I use url of my mobile app instead of web app url for Authorized redirect URIs, it work, but not redirected to my web site.
How I can specify different urls for Authorized JavaScript origins and Authorized redirect URIs?
You are likely running into the External Redirect URIs based on your Hosted comment. Check out the authentication section of the developer guide here: https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-cordova-how-to-use-client-library/#auth - the last section is on updating CORS and the external redirect URIs.

Resources