Trouble logging into my web application with google oauth2. - oauth-2.0

I am having trouble signing into my web application. I am using oauth2 for sign in. After signing in with my gmail account it just brings me back to a blank white page with a google sign in button on the top left corner. the url reads: localhost:8000/login In my google api console I tried editing the authorized redirect URIs. And as well in the json file. But it doesn't seem to do anything. How do I direct the oauth2 login to the correct webpage after signing in?
console.developers.google.com/apis

I removed the 0.0.0.0 from the Authorized JavaScript origins in the google developer console.
Used Authorized JavaScript origins: http://localhost:8000
Authorized redirect URIs: http://localhost:8000/oauth2callback
And I added the GET method in addition to the POST method. #app.route('/gconnect', methods=['POST','GET']) in my application file. This worked for me.

Related

Twitter OAuth CORS error while redirecting user for authentication from server

I am trying to build an application for my users so that they can log in to my website using Twitter and they can manage their Twitter account from the website itself.
I have created a full 3-legged authentication flow and other managing API calls at my server (some server url) when I call authentication API from the browser it works fine.
But now I want to use a webpage for my users so that they can log in and manage their accounts from that website (a website URL different that server url). So I am trying to create a flow like this:
User will click to log in on my website.
Website will send a login request to my server with the user credentials so that I can verify the
user and its request at my server first.
Then the server will redirect the user to the authentication page of Twitter.
But this is not working, I am getting a CORS error in the console, I attached a screenshot for reference.
Thank you.
Error I am getting in console
I have tried whitelisting server and website URL in twitter developer console.
I know the flow may work if I return the authentication url from server to frontend and navigate user to that url, this may get rid of CORS, but I want to know whether this can be achieved by directly redirecting user to authentication URL from server?

Google sign in - enable server side access ios redirect_uri_mismatch

I have integrated the google ios SDK for a signIn in my app and able to generate the authorization code using the same. While trying to use the same authorization code on the server-side, I keep getting the redirect_uri_mismatch error. There is not any redirect URI set in google API console for Web client (Auto-created for Google Sign-in).
Here is my credentials details
I have downloaded the same credential JSON and using it with the Python code provided in the google doc.
Any help would be much appreciated.
Redirect UI is important for web applications in order to know where to redirect after login is completed. Add one which is applicable in your case or you can add base url of your website for it work in case you are just adding google sign-in in your app and not on web.

How to fix my Facebook Login issue with ominauth and rails?

Im trying to make my facebook login works with my application. This is my setup on facebook developer:
My applications is running correctly on my heroku server.
When I try to sign with Facebook I get this 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.
What Im missing here?
Thanks

Laravel 5.2 w/ OAuth2: how do I switch routing depending on whether an auth token was sent at all?

I have a route that is currently behind the OAuth2 middleware. If someone hits it with a valid auth token, they get the content. If they hit it with an invalid token, they get a 400 error. So far, so good.
The issue is this route serves two purposes. It delivers content to users of a client app, who provide an auth token with their request. But it also serves as a link for sharing content with others. When someone clicks on that link in a browser, they will not supply any auth token. In this case, instead of a 400 error, I want to redirect them to a landing page with a smart banner for deep linking purposes. This way, if they don't yet have the app, it will give them the app store link to download it. If they have the app and are using their mobile device, the deep link will cause the client app to open and go to the specified content (using their auth token).
How do I separate out the OAuth2 behavior for an invalid token vs. no token provided?

Valid Oauth redirect uri's

Im making an app and Im integrating Facebook's login. On the app page in the settings its asking for a valid oauth redirect uri.
My url scheme is fb followed by the numbers e.g. fb123456798 .
How do I make an uri based off that ? I need the uri so my app gets called back after user authentication.
Thanks !

Resources