i developed a sync option for a CRM system with google calendar. the system is installed in a certain domain.
i get a refresh token and access token for each user in the system and store it in the user profile.
it works great.
now a friend of mine wants that deveopment for his CRM system too (in a different URL).
Does that mean i need to open a new project for him too? or can i take refresh tokens and acess tokens extracted using the first project and copy them to the users in the other CRM system?
in short:
1. Do i need to open a new project in the developer Console for every CRM system hosted in different URL?
2. Is there a limitation to the number of projects i can open ( in case i install this CRM system in tens of businesses with different URLs)?
3. i read that i can only get 25 refresh tokens per project, what happens if the CRM system has more than 25 users? didn't find any information... do i pay Google for more? how much?
This is going to end up being more of a clarification then an answer but its to long for a comment.
The point of developer console is to identify YOUR application. Each application should have its own project on developer console. If your friend wants to develop his own application then he should have is own project on developer console.
Copying refresh token
If your friend is using your application then he should could use your project id. Basically if the code is the same you can keep it as the same project. If your friend does take a copy of your program for his use technically speaking you could copy the users refresh tokens, as long as he has them and your client id and client secret they will work.
But I think you may want to consider how wise that is. Users are giving you access to there data, they have not given your friend access to there data. I am not sure if this is against some privacy policy, I will have to check but IMO it should be. You should not be sharing authentication granted to you by a user to someone else.
If it was me even if he was copying your code he should still have his own project and get his own users.
Quota
The main problem with sharing a project is that you will also be sharing the quota. I am not sure what api you are accessing but you are aloud a limited number of requests per day. If you are both using it your both eating away at the quota.
25 refreshtoken
That part of the documentation is a little unclear. Its 25 refresh tokens per user per client. Example: So I could authenticate your application 25 times all 25 refresh tokens will work when I authenticate you again the 26th time the oldest one will then stop working.
Your application can have an unlimited number of users.
Related
I really tried, but didn't find any matching answers, most of them are about Android dev/single app info, google play scraping etc.
Anyway, excuse me for possible duplicate.
So, i can see the list of apps which are/were installed on my android device in google play interface ("My Apps"), so, is there any way to get that list in my PHP application, through some kind of API, maybe?
Question is not about tracking my own apps, but about tracking installs of any random app from the given list, on a specific device/google account
What i want to achieve:
User installs an app from the list
After some time/trigger, PHP backend checks, if this app is installed on user's device, and saves this info to DB
EDIT: It is meant, that user agreeds to share this information, to get some kind of reward, after installing an application.
Thanks for your attention.
No, which apps a user has chosen to add to their device is treated as confidential information, and a random person cannot just query that from a server. There are only two ways you could check this:
Do it like advertising libraries do. They use the Google Play referrer API which finds out the referral code which prompted the install, and sends this back via the Ad library in the app.
Or have your own app which is on the device and uses PackageManager.getInstalledApplications() to find out the applications on the device.
I have a Facebook application on my website. This application publish on behalf of the registered user on his time line one post daily or weekly. The users IDs are stored in a database and using cron jobs the publish is occurred. My application uses PHP SDK.
Everything was going fine, till 30 April 2015 the date at which Facebook upgraded their API.
Currently the application's publish action returns this error:
OAuthException: (#200) The user hasn't authorized the application to
perform this action
In addition, during my login in the Facebook and from the same browser (I'm the admin of the app) the application's publish action works fine.
The developer's announcement and suggestions for apps is confusing, and I could not determine whether I have to change my application's source code? Or there is something easier?
Special note: the PHP SDK that I use is one file included as vendor in my website application, which is based on CakePHP 1.3.
Supplemental Edit
This is a screen shot of quickly reply from the Facebook, it has just taken less than 24 hr. to reply from the Facebook. In which detailed answer why they are not grant my app publish permissions. It is supported with screen shots to show my app in action and other demo screen shots about how should it going to be.
Supplemental 2
After the second review try, it becomes clear that Facebook prevented any automated publish on the behalf of the user to his/her timeline. The question here: Is there any other way? such as automated private message to the user?
Yes, if your application started breaking, you'll need to make modifications. What those modifications depend on what triggered that error. Your users will also need to go through a flow to authorize your application (probably for the publish_actions permission, from the sounds of that message).
Note that this permission now requires Facebook review your app, and if you're auto-posting for the user you're probably violating the policy at https://developers.facebook.com/docs/apps/review/prefill.
Incidentally, you should've been receiving emails about this for the last few months. Expect delays with review for the next few weeks as everyone else who didn't upgrade in preparation files tickets/review requests.
1 - Is possible to run upload/download of files to google Drive API using always the same access token, a sort of shared host for all my site's users, where they can upload and download directly files? if yes how to do that? Just using "static" access token variable in php client creation/authorization?
2 - Why i setted up my web application project on google api console enabling Gdrive api and it still tells me that my redirect url mis-match? i created the app about mmm... 2/3 hours ago. Need to wait more? I checked the url and they both matches on my script and in console api.
3- As i see from the api console, is possible to require more quotas reached the 500K requests per day, how it works? does this require for billing? How much more quotas can i ask and in which cases?
Thanks.
1) instead of sharing someone's credentials, you should use Service Accounts. Remember that access tokens expire in one hour, so your approach would still need to take care of refreshing those tokens.
2) there's no delay between the time you configure your credentials in the APIs Console and the time they are live. Please double check that your redirect URL matches exactly the one in the APIs Console, including trailing slashes and http/https.
3) if you need more quota you'll have to fill a form explaining what you need. No billing is required when if additional quota is granted.
I am writing the spec for a complex business solution; it is basically a set of web apps that are all on their own servers. I want them to be independant so if one has a problem or becomes very busy then the rest are not affected.
There will be a central server that will act as the payment gateway for the apps as well as providing data to the apps themselves. The data is minimal; user ids, have they paid for that app etc.
The idea was that when an app was purchased then we'd just pass that data to the app in question.
The question is how to do this while not holding up the user's experience while we wait for the app server to resoned. The idea was to enter it into a queue and process them one by one on a cron job. However there are concerns that this will not be fast enough and the user could have to wait before accessing the app.
The other idea is that the app just contacts the main server when the user tries to use it. The main server can then approve the user and this will be kept on the app server DB so it doesn't have to check again.
What do you all think about these ideas? Is there an obviously best way of doing it?
The system should be able to scale to 100+ apps and tens of thousands of app purchases an hour.
Very interested to see what you all think! Many thanks
I have a similar but slightly different situation here, supporting a potential competitor... have I gone mad?? haha
To the topic, we use cURL to connect the server requests generally, especially if we don't want information to be public, we have a specific VPS set up for payment handling, account functions and financial functions, this will post to a centralized mySQL database for access information only so it will support a single sign on for multiple apps on multiple server clusters.
To ensure the user is immediately moved to the app they want and it works correctly, we use cURL to post initial data creating the default records in the specific app database, we then set up a PHP header redirect using to move the user to the app requested with the single sign-in already working as part of the cURL post preformed earlier.
An access key is important to us as it enables the single sign-on to be secure. It is generated 1 time per account and never updated even though we can if there is ever a security violation. We then use cURL in the user auth process to ensure the user is still signed in using their key and user id. The key is never actually passed publicly but always posted server side using a cURL method hiding it in the PHP.
I hope this helps.
Hi guys I'm building a Google Apps based solution. Basically I'm setting it up such that:
When a Google Apps account holder installs it he/she enters the authentication details for a single Googles Apps account to be used - that account would be used by all users of the instance of the installed system for uploading to Google Docs associated with that account and managing Google Calendar entries associated with that Google Apps account.
The user as mentioned can create other users and invite them to sign in from a separate login screen and they should be able to interact with the system's facilities which allow interaction with the services associated with the Google Apps account used to install the system.
Any other user of the same domain as the original user can also install the system and be automatically associated with the instance created by the user of the same domain.
I got parts one and three all set up but the second part is where I'm stuck - I'm storing the credentials for the centralised Google Apps account in a database and would need a way to authenticate seamlessly using the details i.e. I don't want the users to have to add in the sign in details nor have to go through the process of having to be asked for permission to allow the application to access the Google Apps services - I wish that when the users log in they are automatically transparently also signed into the Google Apps account as well and be able to use its services.
How can I do that I wish to do away with the process of 'asking the user for which account to sign in or the Google Apps login screen' and the second step asking for permission to allow the application access to the account.
I know it can be done - I've installed loads of applications and none of them require me to go through this two pronged process of authentication which I find quite unnecessary - what do I do? - Help please!
Have you seen the Zend Frameworks' Zend_Gdata? It's a PHP 5 interface for accessing Google Data, at first glance it seems to do all the things you want.
http://framework.zend.com/manual/en/zend.gdata.introduction.html
You will need to take over the authentication process to handle authentication of Web sessions. The good news is that you can indeed do that (SSO / SAML), bad news is that it can be a lot of work.
Essentially you'd build your own SSO provider, stick it in front of your domain (so it handles all auth), and let it handle the login process so it's as seamless as you need it.
At a higher level, it sounds like you are using a single account to proxy multi-user access into Google Apps; you might want to check the TOS as I'm pretty sure that's frowned upon (kills traceability).