How to Create OAuth Client ID? - google-api

I am trying to run this github project.
For this I need to create credentials and OAuth Client Id.
When I click to create. After selecting web applications and typing the name I see authorised javascript and authorised redirect uri.
So what should I enter there because I tried with keeping both fields empty. But I got error saying no redirect url found for client id
Please help me.
I am using Developer Console for first time can't find any help on internet. This site is my last hope.
I did as said in [comment].2
Here is what I got in Linux shell and the error i received on redirected url opened webpage.
Linux Shell Message
/YouTube-Subscription-Importer/env/lib/python3.6/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access subscribe.py-oauth2.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?client_id=1069660256195-n8adm0dmi70v29i55hcfblftle09hb5n.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube&access_type=offline&response_type=code
If your browser is on a different machine then exit and re-run this
application with the command-line parameter
--noauth_local_webserver
Snipe of what redirect url webpage said
**MOST IMPORTANT
I am running this in windows bash.
Now tell me what to do next.
I just simply need a tutorial/how-to use guide for Google developer console credentials and OAuth Screen.
**

You need the redirect URL, you will be redirected from Google OAuth Consent Screen to https://REDIRECT_URL?code=AuthorizationCode, you can just set it to http://localhost.
After creation, you can your find Client ID on the Credentials page.

Related

HttpError 403 google directory api

I got the super admin privileges for to my Google Account.
I need to get the list of all the chrome devices through an API.
I did enable Google Admin SDK but still facing some issues.
I copied the exact python script from Python Quickstart for checking but still getting error as
"googleapiclient.errors.HttpError: https://www.googleapis.com/admin/directory/v1/users?customer=my_customer&orderBy=email&alt=json&maxResults=10 returned "Insufficient Permission">"
When checked on Admin SDK API dashboard I can see 4xx errors for every call made from my python script.
When you run the sample you need to make sure that this step
The sample will attempt to open a new window or tab in your default browser. If this fails, copy the URL from the console and manually open it in your browser.
If you are not already logged into your Google account, you will be prompted to log in. If you are logged into multiple Google accounts, you will be asked to select one account to use for the authorization.
Is done from the Google account which has access to your admin account. The user you are logged in with now does not have access.
I managed to get Super Admin access of Google account and then grant access to my project for different scopes. The docs/ references are so confusing hence it took a while for me to figure it out. So under the admin console, we have to get into Security >> Advanced Settings >> Manage API Client Access(under Authentication) and then add the client name and the scopes(multiple scopes separated by commas) for which we need access. Client name is the client-id which we can get from the client-secretxxxxx.json file(downloaded while creating the oauth id).
NOTE :- You do NOT need super admin access it is just that I was new and the guy who gave me the initial access wasn't sure what has to be enabled across.
Also couldn't post as a comment due to the limitation of characters.

Why is the my oauth page refreshing instead of authorizing the user?

I am using jekyll-google-auth to secure this website. Visiting the site should prompt the user to authenticate with google, and if they are in my company domain, they should get access to the site.
I have the google app set up, my dyno is up and running, but when I visit the site and click "allow" (or "deny" for that matter) I am not redirected to the site, instead it seems to refresh to the same auth page. I can click "allow" or "deny" indefinitely and never get to the site.
My redirect uri in my google app settings is:
http://dash.fractalhardware.com/auth/google_oauth2/callback
The command jekyll-auth new is supposed to run through setup for you, but it failed for me. It spit out an error when I entered my domain when prompted for GOOGLE_EMAIL_DOMAIN. So I went into the heroku settings and just added it manually in the config variables. I read through the code for the jekyll-auth command and confirmed the setup should've been complete. I don't think that's related to the auth problem but it's the only obvious hiccup I've come across.
Any idea why the oauth page seems to refresh/redirect to itself instead of authorizing the user and showing the site?
Thanks,
Dave

firebase hosting - terminal hangs waiting for authentication

I just created a firebase account using my Gmail account and I want to test deploying a simple JS app to the cloud. I'm using Linux. I type in firebase init and the terminal says, "Waiting for authentication" then the browser opens and for a quick second I see a message "Authenticate Application" but then it disappears and asks me to login to my Google account. I login and it redirects me to my dashboard. In the terminal window it is still waiting for authentication. So the browser never tells the terminal window that I logged in and is stuck.
Any ideas?
I found a different thread with an answer that worked for me (How to login to `firebase-tools` on headless remote server?)
On the terminal use the following command:
$ firebase login --no-localhost
A different authentication link will be generated. On any machine, open a browser and paste the link from the terminal.
The result is an authorization code that you now need to paste into the terminal.
Everything should work well...I hope...
before firebase init you should be logged in (firebase login)
if you hit firebase login
first your cli asks permission to allow firebase
Allow Firebase to collect anonymous CLI usage information?
type yes and hit return
now an url will be generated
copy the url and open in any browser
login (if required)
if you are using first it asks for permission when you hit ok
login successful

How to get different connection for different browser session/machine so I can get different profile feeds?

I followed tutorial on:
https://spring.io/guides/gs/accessing-facebook/
I run the application and successfully authenticate with a single user. Home page returns my feeds.
Now I connect to the application from another browser/machine and go to home page - I see feeds of first browser session/machine.
I am expecting to be asked to log in again when connecting from different browser/machine.
What am I missing?
Didnt try it, and depends on exact configuration :
When you logged in on the first browser you gave facebook the permission to allow your application to access your facebook account.
If you are logged in to facebook before on the other browsers with the same user, the permission given to the app through interaction on the first browser might be sufficient.
You can try to use incognito mode on a browser, in this case you should definitely have to authorize again.

Yammer authentication

I have registered a dummy app with Yammer, as I am still in testing phase. I gave the homepage of my org as the redirect URI. Honestly, there is no app hosted anywhere. Still, I think it is possible to test the authentication and go till creating a token. This is what I have done.
Navigated to https://www.yammer.com/client_applications page.
Registered an application. I provided the "RedirectURI". I got a "Client Id", "Client Secret", and "Expected Re-direct".
Since I don't have an app to launch anything from, I manually typed in the following URL in the browser. "https://www.yammer.com/oauth2/authorize?client_id=[:client_id]&response_type=code&redirect_uri=[:redirect_uri]".
I was taken to the app registration page. I clicked "Allow".
Now the page is redirected to the home page of my org, as I provided along with "www.<<>>.com/code=".
I copied this code over, tried to launch "https://www.yammer.com/oauth2/access_token.json?client_id=%s&client_secret=%s&code=%s".
I expected a token to be created, so that I go back to my dummy JAVA program and start connecting to Yammer, but I am not allowed to connect in above step. I am getting a "Not Authorised" error.
Can some please point out what I need to do? My requirement is that I get this token not from with in an app, but then on use it in a SWT based Rich Client JAVA application to connect to Yammer.
I think the request to oauth2/access_token.json needs to be a POST not a GET

Resources