Facebook and Google Redirect URL are not HTTPS - asp.net-mvc

https://www.example.com
I've installed SSL to my ASP.NET MVC 5 site, but the problem is the when I clicked Login with Facebook or Google the redirect url is not https
https://web.facebook.com/dialog/oauth?response_type=code&client_id=xxxx&redirect_uri=**http**%3A%2F%2Fwww.example.com%2Fsignin-facebook&scope&state=xxxxxx
this creates redirect mismatch bec i've registered the https version
how can i solve this?

This might help?
The redirect URI (where the response is returned to) has to be
registered in the APIs console, and the error is indicating that you
haven't done that, or haven't done it correctly.
Google OAuth 2 authorization - Error: redirect_uri_mismatch

Related

Facebook Oauth URL Blocked

I'm currently testing my Ruby on Rails project Omniauth with Facebook functionality and no how I enter my Redirect URI it fails.
The exact error is:
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.
If I do,
https://localhost:3000/users/auth/facebook/callback
it then complains about trying to an ssl certificate to a non ssl puma. Are there any suggestions for this issue? Perhaps, working on my SSL certificates or any other solution.
I've been looking into similar posts and nothing has solved this issue. Please advise.

Getting login and redirect issues from Google

Trying to set up an Authentication for my app, and all seemed to be working correctly, but when I tried testing it out I got this error message
Authorization Error
Error 400: redirect_uri_mismatch
The redirect URI in the request, http://localhost:3000/api/auth/callback/google, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/${your_client_id}?project=${your_project_number}
Can you point me in the right direction to fixing this?
Error 400: redirect_uri_mismatch
Is a configuration issue. The redirect uri is used to return the authorization code to your application after the user has consented to your applications access to your data. You have created a web client credentials up on Google developer console.
What you need to do is go back there and add a Redirect uri of
http://localhost:3000/api/auth/callback/google
It must match exactly don't add any spaces at the end or anything.
If you have any issues i have a video which will show you exactly how to add it Google OAuth2: How the fix redirect_uri_mismatch error. Part 2 server sided web applications.
Seems like there's a mismatch with the Authorized redirect URIs. Are you sure you have entered the correct URIs? Redirect URI should be the URL that you'll be redirecting the user to after the login page or the base URL of your application Eg: https://localhost:8000
Also, make sure that you are using the correct Client ID and Client secret
Similar Questions
Google OAuth 2 authorization - Error: redirect_uri_mismatch
Correct redirect URI for Google API and OAuth 2.0

How can I edit existing Authorized redirect uri in google console?

I created an oAuth key for my laravel site for google login. I successfully implemented this in local. But when I migrated my site to live I got this error:
400. That’s an error.
Error: redirect_uri_mismatch
Request Details
client_id=xxxxxxx-0fic8dnvcgo672unju9ai619iXXXXXX.apps.googleusercontent.com
redirect_uri=https://laravel.themenepal.com/gharsansar/auth/google/callback
scope=openid profile email
response_type=code
state=NRu0eU9UdwEXYSV0dixOc0BjuH3bluFkHiBDJFgO
That’s all we know.
I think this is primarily due to redirect url being mismatched with what is set in Google console. I've changed the redirect urls in .env. I have searchd a lot to be able to update the redirect uri in google console but nothing helped.
If you know that would be a great help.
UPDATE: The screenshot of the url edit page is as follows:
If you goto: https://console.developers.google.com/apis/credentials and select the correct project, then the correct the correct OAuth 2.0 client IDs and edit the correct OAuth 2.0 client IDs.
There appears to be no option to edit it if it's created as an OAuth 2.0 client ID of type "Other." If you choose Web Application, you can edit them yourself.

How do I correctly set up Omniauth + Devise + multiple providers

My facebook authentication works. My twitter login however only works on localhost. My google does not work at all.
For google, I get the error:
400. That’s an error.
Error: redirect_uri_mismatch
The redirect URI in the request: http://unstarv.herokuapp.com/users/auth/google_oauth2/callback did not match a registered redirect URI.
For Twitter I get a similar problem in production on heroku though localhost works for Twitter login.
The Redirect URI I set up in both the twitter and google apps is :
http://unstarv.herokuapp.com
While the URLs I get after trying to log in these apps are:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=XXXXXXXXXXXXXXXXXXXXX
http://unstarv.herokuapp.com/users/auth/twitter/callback?oauth_token=XXXXXXXXXXXXXXXXXXXXX
Did I set up correctly my redirect & Callback URI s ? How come the Twitter login works on localhost but not on heroku ?
Thanks !!!
You shoud add this in your google console
http://unstarv.herokuapp.com/users/auth/google_oauth2/callback
While on Twitter I set
http://unstarv.herokuapp.com/ as a callback URL

Sign in with Yammer is using 'http' instead of 'https' so fails with 'Invalid Redirect URI' error

Yammer login works correctly when I am logging in using my own Yammer account for our network. Whenever I use anyone else in our network I get an 'invalid redirect uri' error. Is there a reason why it would only work when I am logging in and not other people? Would the redirect uri error be purely Yammer server side related?
I had everything set up correctly in the Yammer created apps but I was visiting my production url using http instead of https. This was then overriding the redirect uri. I could fix this by changing the url on the invalid redirect_uri page to include the s and it would redirect correctly.
Seems like a bug that the source url would override the http part of the Yammer Created Apps redirect uri.

Resources