google-admin-sdk

Google php client library loadServiceAccountJson broken - fix enclosed

佐手、 提交于 2019-11-28 06:49:03
问题 The new function in the php library loadServiceAccountJson doesn't allow setting sub in the Google_Auth_AssertionCredentials creator, so always gives authorization fails. How do we get the library updated? The following instructions will allow a working query, in my case to the Admin SDK Directory API: First, update the php library function loadServiceAccountJson in src/Google/Client.php to this: public function loadServiceAccountJson($jsonLocation, $scopes) { $data = json_decode(file_get

Google: Permission denied to generate login hint for target domain NOT on localhost

我们两清 提交于 2019-11-28 06:14:27
I am trying to create a Google sign-in and getting the error: Permission denied to generate login hint for target domain Before you mark this a duplicate, this is not the same as the question asked at Google sign in website Error : Permission denied to generate login hint for target domain because in that case the questioner was on localhost, whereas I am getting this error on the server. Specifically, I have included the url of the server in the Authorized Javascript Origins, as in the following image: and when I get the error, the request shows that the same url was sent, as in the following

How can an Admin access the Google Drive contents of all the users in a particular domain?

痞子三分冷 提交于 2019-11-28 05:00:50
问题 I am developing a tool to automate the transfer of ownership of Google Drive documents from one user to another using Admin SDK which is run by the admin. I used the Data transfer API for the ownership transfer. I wanted to validate the transfer by checking the size/number of the google drive documents before and after the transfer for which the admin account must be able to access the Google Drive contents of all the users in the domain. Is there a way to do that? Or is there a better way to

Received error “Not Authorized to access this resource/api” when trying to use Google Directory API and Service Account Authentication

时光怂恿深爱的人放手 提交于 2019-11-28 04:06:34
问题 I'm really struggling with trying to use Service Account authentication to use the Google Directory API (Admin SDK). Using client based three legged OAuth this works (tested here - https://developers.google.com/admin-sdk/directory/v1/reference/members/insert) but there's a problem with the permission delegation to the service account I am using. Under the Google Apps administration, I enabled using APIs and added the service account to the list of allowed OAuth clients as instructed. Here is

How do I find the immutable id of my Google Apps account?

痞子三分冷 提交于 2019-11-28 02:48:44
问题 Many of the Directory API calls require a customer parameter referred to as the "Immutable id of the Google Apps account. (string)". e.g. GET https://www.googleapis.com/admin/directory/v1/customer/ customer /domains I have no idea how to find/generate this for my Google Apps account. I am an admin. Can someone point me in the right direction please? 回答1: I was able to find the customerId as follows Go to admin.google.com Security -> Set up single sign-on (SSO) You will see URLs like this:

Google Directory API returns Not Authorized when call users().list().execute()

江枫思渺然 提交于 2019-11-27 22:34:37
问题 I need to read the list of users (and groups) from my google domain. So I went to my Google APIs Console and enabled Admin SDK and created a Service Account to call Google APIs. I use the following google libraries google-api-services-admin-directory_v1-rev11-1.16.0-rc.jar google-api-client-1.16.0-rc.jar My code is /* * Global instance of the JSON factory. */ final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); /* Global instance of the HTTP transport. */ HttpTransport

Converting string to web-safe Base64 format

橙三吉。 提交于 2019-11-27 14:54:33
I am testing how to update user picture using the Admin SDK Directory Service with Google Apps Scripts with the following function: function updatePhoto(){ var fileId = 'XXXXXXXXXXXXXXXXXXX'; var b = DocsList.getFileById(fileId).getBlob(); var encoded = Utilities.base64Encode(b.getBytes()); encoded = encoded.replace(/\//g,'_').replace(/\+/g,'-').replace(/\=/g,'*'); AdminDirectory.Users.Photos.update({ "photoData": encoded },'harry.potter@abc.edu.hk'); } However, it doesn't always work. Whenever there is padding in the base64 encoded string, it fails. Referring to Google's document ( https:/

Google Admin SDK Unable to Create User - Exception 403 Forbidden

冷暖自知 提交于 2019-11-27 08:25:10
问题 I am trying to create a user using C# and the google-admin-directory_v1-rev24-csharp-1.7.0-beta client libraries however I keep geting an exception: Google.GoogleApiException was unhandled HResult=-2146233088 Message=Google.Apis.Requests.RequestError Not Authorized to access this resource/api [403] Errors [ Message[Not Authorized to access this resource/api] Location[ - ] Reason[forbidden] Domain[global] ] Source=Google.Apis ServiceName=admin StackTrace: at Google.Apis.Requests

How to get the list of members in a Google group in Google app script (Admin SDK)?

牧云@^-^@ 提交于 2019-11-27 06:29:56
问题 I would like to get a list of members in a Google group using Admin SDK. But im not getting how to do this. I found below link - https://developers.google.com/admin-sdk/directory/v1/guides/manage-group-members But I do not know how to use POST method in Google app script. Can someone please guide me with an example? UPDATED I got the output as below, But i would like to access each element (role,email) separately for each member of the group. Is that possible?? { "role": "OWNER", "kind":

Google: Permission denied to generate login hint for target domain NOT on localhost

断了今生、忘了曾经 提交于 2019-11-27 01:01:22
问题 I am trying to create a Google sign-in and getting the error: Permission denied to generate login hint for target domain Before you mark this a duplicate, this is not the same as the question asked at Google sign in website Error : Permission denied to generate login hint for target domain because in that case the questioner was on localhost, whereas I am getting this error on the server. Specifically, I have included the url of the server in the Authorized Javascript Origins, as in the