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

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.

Related

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

Facebook and Google Redirect URL are not HTTPS

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

Error when using customized port in redirect_uri in google oauth2.0

Whenever I use a customize port in the redirect uris, google will redirect me to an error page saying "OpenID 2.0 for Google Accounts has gone away", try to click the link below to recreate this issue
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login&state=kkk&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fcheckauth&response_type=code&client_id=247142348909-2s8tudf2n69iedmt4tvt2bun5bu2ro5t.apps.googleusercontent.com&access_type=offline&approval_prompt=force
But when I delete the port from the callback url, google can redirect to the specified redirect uri.
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login&state=kkk&redirect_uri=http%3A%2F%2Flocalhost%2Fcheckauth&response_type=code&client_id=247142348909-2s8tudf2n69iedmt4tvt2bun5bu2ro5t.apps.googleusercontent.com&access_type=offline&approval_prompt=force
The two urls are exactly the same except the second one does not have ":3000" in the redirect_uri parameter. Is there something i miss here?
In May 5th, both links can successfully redirect to the specified URLs, problem solved

OAuth2 not working with https in redirect_uri

I'm using https in redirect_uri field of OAuth2. But when I connect to google client, I'm redirect to http url, not https. Here is a part of the code:
$client->setClientId($client_id);
$client->setClientSecret($secret);
$client->setRedirectUri("https://mydomain/myphp.php");
$client->setScopes(array('https://www.googleapis.com/auth/calendar'));
I use the example from http://www.daimto.com/google-oauth2-php/
When I run the script, it shows me a "Connect Me!" message and when I click on it, the browser ask my permition to access my google account. After I agree, it would must redirect me to the address in setRedirectUri, in HTTPS mode. But google api redirect me the same url but in http mode.
Some idea?
Thanks a lot!
I believe all is working, but after successful authentication on https your own code redirects you to a cleaned URL on plain http. Check the sample code that you copied after receiving and exchanging the code ("Step 2") and change the construction of the URL so that it uses https instead of https.

Google auth redirect_uri no longer authorized even when the same uri is placed in settings

I'm getting a redirect uri error for google authentication even when I've already placed the EXACT url in the google dev console config settings. Anybody know what could trigger such an error?
Below are screenshots of the error. I have the exact uri authorized in the settings yet trying to authenticate leads to a redirect_uri error!
I just figured this out. If you're ever as dumb as me and your google app has multiple client IDs you could be using a different client ID for authorization then the one you're setting your redirect uri to. When you're changing the redirect uri, check to see if you have another client_id and set the redirect_uri for that.

Resources