How to login with Google account through the API [For Testing] - google-chrome

can you guys help me please to find any information about it, I'm sure there are good sources in which I could find all answers.
I have a testing project which requires me to login with a Google account into the web site, but the problem is that I cannot do it manually, like enter all data such as pass and mail itself, there are a lot of things preventing test to log in, different security stuff doesn't allow to use it like that.
I have tried to find some info but there are only "how to implement a google auth 2.0 into your web application", I believe that's not what I need.
I need just to log in into google account using some Testing framework, that's all.

Related

How do I get Google Drive access for a desktop app?

I'm trying to write a Python program that uses Google Drive to do some custom backup and sync work from my Linux desktop.
I started using the PyDrive2 library, and followed its recommendations on how to sign up for Drive API access. When I run my program, it accesses Drive as I'd expect it to, but my authorization expires after a few hours, which is not going to work for a program that runs in cron. I thought this might be because my app is not verified, so I looked into verification, but it's asking for things like a my application's home page. Mine isn't a web-based application, so I don't have one.
Is there a good way to access Google Drive APIs from a non-web application?
if your access is expireing after only a few hours it sounds like you are not requesting offline access and storing the refresh token for later use.
If you followed Quickstart pyton You may have noticed this section. The users credetinals that being the refresh otken and the access token are stored in token.json for future use by your application.
# The file token.json stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists('token.json'):
creds = Credentials.from_authorized_user_file('token.json', SCOPES)
I thought this might be because my app is not verified, so I looked into verification, but it's asking for things like a my application's home page.
Your application only really needs to be verified if you are going to have other uses using it. If your only using it yourself then you really only need to remove it from testing phase and put it into production then your refresh tokens will last longer then seven days.
You could try to use a service account but i don't know of anyone who has gotten service account authorization to work with curl.

Can google script be used to make the list broadcast

Can google script be used to make the list broadcast api for you tube and the stream and basically can you make the broadcast samples using scripts i have made the other samples but it is unclear if scripts can be used to the broadcast. Also it appears that depending on the manor of which i access the scripts app I get different options. For instance if i access the the scripts app using google drive I can share and other stuff that is not available if i access the google drive though api and the regular free account. I wonder if there is a better way to access to get all the services? I think before the scripts service would not work for the broadcast. however it appears it has been updated is that because i have a credit card on file now? i notice i have more options now than before in scripts.
I found the answer yes you can make broadcast api from you tube ver (3) on google scripts as long as you have a credit card on file. That's cool google deserves to get paid. With out your card key elements are missing in scripts and everyplace else. Makeing it difficult if not impossible for hacks like me to get the api back on the internet. But with a credit card on file wow two clicks and its done no coding nada just change out the public api credential. I just wish this would have been told to me months ago. and please everyone forget about java, go, java-script and everything else if you want a web-service or web app from youtube api. Use in this order Python .php google scripts. But i did learn how to become a expert developer its called master card. this is my experience only and i still think its a great thing but if your not a genius use your card you will feel like one.

Box v2 API - Basic questions

I have a fairly basic question regarding the new Box API v2.
I have developed a Firefox extension (FEBE) that performs automatic, scheduled, unattended backups of the user's Firefox profile. These backups can (optionally) be automatically uploaded to the user's Box account. I currently use the v1 API and it has been working fine for several years. I now see the v1 API is being deprecated in December, 2013. Does this mean it will no longer work, or that it is just no longer supported?
If I have to re-write my code (JavaScript) to handle the v2 API, will I still be able to provide the upload capability without any user intervention? FEBE securely stores the user's Box username and password and silently logs in to initiate the upload. From what I've been able to research so far, it seems the OAuth 2 verification process requires an interstitial page to confirm the users credentials. Is this true? If so, that would remove the 'unattended' aspect of the backup.
Also, can anyone recommend a good source of JavaScript code snippets that show examples of the Box v2 API in action (preferably not JQuery, just plain, old-fashion JavaScript)?
Does this mean it will no longer work, or that it is just no longer supported?
Yes, in December 2013 the V1 API will cease to function in its entirety.
…will I still be able to provide the upload capability without any user intervention?
The user will need to go through an initial web flow once to authorize your use of their account. After that, you can perform everything in the background.
There aren't any good sources of sample JS that I'm aware of, hopefully someone else can chime in on that.

Accessing the Administrator Audit Log via Google Script

Despite fervent searches, I don't believe I have come up with quite the results I am needing. Within the Google Apps for Business Administrator console, under "Reports" there is the "Audit Log." This audit log nearly displays everything I need; however, I am needing the actual name of the file instead of the fileID provided in the report.
The ultimate endgame is to generate, via Google Script, an automated daily report that gives this same data to a few users daily. Is there any means by which I may access this data? I have been pouring over the APIs, and perhaps I've missed something, but I don't feel that I've found what I needed.
Any thoughts and help would be greatly appreciated. Thank you for your time and considerations.
This is possible using the Google Apps Admin Audit API. This uses OAuth and that is a bit tricky to setup sometimes. You can see the set up process in this video that we did. Except as the example shows, instead of the YouTube APIs enable the Apps Reporting and Audit APIs in the API Console.
I built out a simple example of this that you can see in operation. Access this URL after having been logged in as the domain admin. It will automatically create a Spreadsheet in your Drive with the latest Audit logs exported. This is a web app that is deployed as "Run as user".
I've open sourced this Github here. You should substitute in the right OAuth2 Client ID/Secret. The code is pretty rough so you'll want to clean it up. I am selectively logging a few columns but if you look at the API docs, there are other things you can log as well.
Once the OAuth token is set up you can have this run on a trigger as well as long as you refresh the token.
Hope this helps.

GAS gadget inserted to googleSite... for non-google accounts

I think this is the same as my question: http://code.google.com/p/google-apps-script-issues/issues/detail?id=852
But just to be clear: Google apps scripts won't run on a Google Site without a google/gmail user being signed in?
...are there other google products where GAS can be deployed for non-google accounts?
Thanks,
Nathan
False. You can embed an Apps Script in a Google Site using Insert > Script Gadget. Just be sure that the publishing setting is set to "Anyone, even anonymous".
You've got two different levels of user identity at work here, if not three or more. I will try to pull them apart for you in a clear way.
Google Sites can work for users of Google and non users. It depends entirely on the sharing settings for that site. If you share it with the world, it will be shared and indexed by search engines. If you share with anyone with link, search engines won't index it but no user will have to sign in to use the site.
What you are embedding in a Google site may have it's own user identity issues. The easiest way to manage these is to go into 'Publish' menu, and 'deploy as Webapp'. You will then see a menu that asks which account the script should be run under, essentially you or the user. And then which people to allow access, which you would select 'Anyone, even anonymous'.
This will run that app as your account, but allow anyone to call it. Works great for allowing the public access to a form created in GAS.
Now the other problems. It may be possible for you to have code in your GAS that specifically calls for a user. In that case all of the prior settings don't matter. When the script looks for a user and finds nothing valid it will error. These call are pretty obvious though and are more rarely used. (At least in my experience.)
But, in short, yes! You can certainly embed GAS into Google sites to be called by anonymous users.
Example of mine: https://sites.google.com/site/greenmountainretreat/sign-up
The issue you are referring to is about inserting i-frame gadgets into non-Google sites... please don't confuse things... and read the issue report thoroughly.
If you want another example...