google-admin-sdk

Using Admin SDK to update group settings with Apps Script

旧时模样 提交于 2019-12-11 11:52:15
问题 Keeping it simple - I'm using Google Apps Script Admin SDK Directory Service to bulk create groups: AdminDirectory.Groups.insert({"email": group1@test.test}); Following this I have been attempting to update the groups permissions using the following: AdminDirectory.Groups.update({ "whoCanJoin": "CAN_REQUEST_TO_JOIN", "whoCanViewMembership": "ALL_IN_DOMAIN_CAN_VIEW", "whoCanViewGroup": "ALL_IN_DOMAIN_CAN_VIEW", "whoCanInvite": "ALL_MANAGERS_CAN_INVITE", "allowExternalMembers": "false",

Is there any way to use an “or” operator in Google Directory API users.list query?

我只是一个虾纸丫 提交于 2019-12-11 09:41:24
问题 I want to build a search query for Google domain users using users.list Google Directory API . I tried to build a query according docs, which will select all users with givenName or familyName starts e.g. on letter "m". I wrote the query: givenName:m* or familyName:m* , but it doesn't work. Only givenName:m* familyName:m* works but it inserts "and" operator between clauses. In docs stays: Multiple clauses are separated by whitespace and are implicitly joined by an "and" operator. Can I only

How to set curl timeout in Google API PHP client version 2.2.2

眉间皱痕 提交于 2019-12-11 09:31:18
问题 I am trying to set the default curl timeout in the scripts I am using for batch updating users using directory api. Only a handful of users are added before the curl connection times out. I have tried this but it doesn't work with the API v2.2.2 Can someone show me how to update the curl timeout settings using php? Thank you. Here is the code: $groupEmail = "my group email"; require_once realpath(dirname(__FILE__).'/vendor/autoload.php'); $client = new Google_Client(); $client->setAuthConfig(

GoogleApps client giving SocketTimeOutException only

江枫思渺然 提交于 2019-12-11 09:09:57
问题 We wrote a client to create a user on googleapps using the GoogleNetHttpTransport, but we are getting a socketTimeoutException when making the user as Super Admin through superadmin api. Connecting User has superAdmin Privileges itself. How to increase the ReadTimeOut/SocketTimeout when we are using the GoogleNetHttpTransport . Please find below code snippent on connecting to target and making the client httpTransport = GoogleNetHttpTransport.newTrustedTransport() ; GoogleCredential

Google Admin SDK - Service account can't access resource

試著忘記壹切 提交于 2019-12-11 06:08:39
问题 I've created Service Account client via console.developers.google.com. Generated keys, .p12 cert, enabled DwD, and so ... Then I've continued as describer in Admin API references. (HTTP/REST version). That included asingning scopes to these clients id at Google Admin -> Security -> Advancet Settings. Current admin security config state After I succesfully exchanged code for access token and made request for list of users under my domain i got this response. { "error": { "errors": [ { "domain"

Reset the login cookie by API

安稳与你 提交于 2019-12-11 05:46:01
问题 I wonder if there is any way to reset login cookies through the API. I know there is how to do this through the settings in admin. 回答1: There's no direct API for resetting the login cookie. There's a workaround idea from this SO post. For more info, you can also check this Google thread. 回答2: According to the G Suite forum, the only way to to do this is through a force password reset using Dito GAM on the user side. Related question from SE: Is it possible to reset sign-in cookies for all

Admin sdk 403 Rate Limit Exceeded

寵の児 提交于 2019-12-11 05:27:37
问题 I am retrieving user's photos using admin sdk in java.I have implemented exponential backoff also. But after few requests, I am getting 403 error code with rate limited exception message. There are 2000 users and after 10 to 20 user's photo. It starts giving 403 error and using exponential backoff it is taking long time to execute. try { Directory directoryService = getDirectoryService(adminEmail); Photos photos = directoryService.users().photos(); com.google.api.services.admin.directory

How can I programatically attach recovery email when creating user's e-mail address

ぃ、小莉子 提交于 2019-12-11 04:50:56
问题 I'm creating an application that creates google apps accounts using a WWW application. User for which we are creating that account provides his personal e-mail address that will be set as an recovery e-mail address (it really makes sense in this case!). I couldn't find a way to set user's recovery e-mail address. Is there a way to do this programatically. 回答1: Like the phone number used for recovery and Login Challenges, I don't believe it's possible to set a recovery email address for a user

403 error from Google Admin SDK with AppAssertionCredentials

大城市里の小女人 提交于 2019-12-11 04:25:40
问题 I'm trying to list users via Google admin directory API. import logging import os from google.appengine.api import memcache from googleapiclient import discovery from oauth2client.contrib.appengine import AppAssertionCredentials import httplib2 from flask import Flask credentials = AppAssertionCredentials(scope='https://www.googleapis.com/auth/admin.directory.user') auth_http = credentials.authorize(httplib2.Http(cache=memcache)) service = discovery.build('admin', 'directory_v1', http=auth

New Google Drive Directory APIs error out: Bad request

早过忘川 提交于 2019-12-11 03:42:19
问题 I am using below piece of code to list all domain users in my simple Console application var certificate = new X509Certificate2("D:\\3acf2c2008cecd33b43de27e30016a72e1482c41-privatekey.p12", "notasecret", X509KeyStorageFlags.Exportable); var privateKey = certificate.Export(X509ContentType.Cert); var provider = new AssertionFlowClient(GoogleAuthenticationServer.Description, certificate) { ServiceAccountId = "877926787679-b7fd15en1sh2oc65e164v90cfcvrfftq@developer.gserviceaccount.com", Scope =