Google OAuth 2 authorization - wrong confiemation link is generated - gmail

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.

Related

Azure Web App created at localhost but not working

I created web app in my Azure account. I have all details like tenat id, client id, client secret etc. While creating I have added uri as https://localhost and I also added scope Data.Read and added Application ID URI. But I can't open above mentioned url. Most possible that I am missing something in my mind and dont fully understand the rule how it should work, that is why I am asking for help. I need this localhost in order to test auth with Azure tokens. What exactly I am doing wrong?
Azure allows http protocol value for only localhost. Remaining all redirect URIs must begin with the scheme https. To use https, you should install SSL certificate.
HTTP: The HTTP scheme (http://) is supported only for localhost URIs and should be used only during active local application development and testing.
I am not sure what error you are getting Azure active directory basically Redirect back to the Redirect URL specified in the request provided to AAD after login using either the /authorize or /token endpoint is what AAD does. If the match is successful, AAD publishes the success response back to the same Redirect URI after successfully authenticating the user. Once the request reaches AAD, it verifies the Redirect URI and compares it with the reply URLs listed in the app registration.
For more information in detail, please refer below links:
How to create Azure Web App | Ciemasen
Localhost exceptions
Redirect URL with http but NOT localhost

cannot load url error in facebook login using node in localhost

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"

"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.

Using OAuth 2.0 for Installed Applications

I am programming a command line tool (installedApp) that will need access to the Google Sheets of the user. For this I need to get an access token from the user.
I am following these guidelines OAuth2InstalledApp. So far I managed to get the authorization code by using the http://localhost type of redirect_uri. I specified http://localhost:7373/authorizationCode as the redirect_uri and I have a local server listening on port 7373.
But when I make the request to get the access token, I get an HTTP 400 Bad request response with a
redirect_uri_mismatch error
. When I make the request,the redirect_uri is defined as "The redirect URI you obtained from the Developers Console". Which is kind of wrong because when you create an Installed app you don't have the ability to specify a redirect uri (only with web apps). https://infinit.io/_/i48b2rM
So my question is what am I doing wrong?
When you create a client ID in the Google Developers Console, two redirect_uris are created for you: urn:ietf:wg:oauth:2.0:oob and http://localhost. Also you can consider urn:ietf:wg:oauth:2.0:oob:auto .The value your application uses determines how the authorization code is returned to your application. choose a redirect uri

Resources