google-directory-api

Google Admin SDK authentication with service account

女生的网名这么多〃 提交于 2020-04-16 08:16:29
问题 My team is currently developing an application to list my company's domain users in GCP, using the Admin SDK, for onboarding and offboarding purposes. We're using a service account to do this and we've have added the admin.directory.user.readonly scope, in the Google Admin's advanced settings, to it. The Admin SDK API is activated and we can see the service account in the Credentials area. When we invoke the https://www.googleapis.com/admin/directory/v1/users endpoint with the parameters

Service account not Authorized to access this resource/api while trying to access directory api using Python

﹥>﹥吖頭↗ 提交于 2020-03-21 05:15:44
问题 We use Python to get all users from a particular G Suite managed domain, but after completing the following tutorial and granting all the access needed to the Service Account, the following snippet still produces "Not Authorized to access this resource/api: import json from google.oauth2 import service_account from googleapiclient.discovery import build SCOPES = ['https://www.googleapis.com/auth/admin.directory.user.readonly'] credentials = service_account.Credentials.from_service_account

Service account not Authorized to access this resource/api while trying to access directory api using Python

梦想的初衷 提交于 2020-03-21 05:15:24
问题 We use Python to get all users from a particular G Suite managed domain, but after completing the following tutorial and granting all the access needed to the Service Account, the following snippet still produces "Not Authorized to access this resource/api: import json from google.oauth2 import service_account from googleapiclient.discovery import build SCOPES = ['https://www.googleapis.com/auth/admin.directory.user.readonly'] credentials = service_account.Credentials.from_service_account

Get Latitude Longitude after x kilometer on Google Map without destination?

流过昼夜 提交于 2020-01-25 22:54:06
问题 I am creating an Android app which requires finding a coordinate on the same route after X kilometers. I have two coordinates x1,y1 & x2,y2 on a road. Now, my requirement is to find coordinate x3,y3 after some 3 kilometers (i.e., coordinate after x2,y2 not between x1,y1 & x2,y2 ) on the same road. How can this be achieved ? 回答1: If you know the bearing, you can calculate the destination coordinate. Sample Code: private LatLng getDestinationPoint(LatLng source, double brng, double dist) { dist

Creating a group with Admin SDK Directory API in Google Apps Script - Error 403

喜欢而已 提交于 2020-01-23 03:31:08
问题 I've read through all of the relevant pages in the Admin ADK Directory API documentation and several questions on stackoverflow, and I'm still stuck. I'm trying to use Google Apps Script (container-bound within the Script Editor of a Google Sheet) to create a group. I am the super admin of my Google Apps domain, and the scripts will be running as me. Here's what I did in the Script Editor so far: Went to Resources - Advanced Google Services... - turned on the Admin Directory API Clicked the

Update user using google admin directory api returns 200 but does not update. Malformed request body?

风流意气都作罢 提交于 2020-01-06 07:58:35
问题 I have a user in my google admin console with the email dog@jopfre.com. I can auth successfully and add and delete users using the api. Now I am trying to update the user using the api. Here is a simplified version of my code: const admin = google.admin({version: 'directory_v1', auth}); admin.users.update({ userKey: "dog@jopfre.com", requestBody: { primaryEmail: "cat@jopfre.com" } },(err, data) => { console.log(err || data); }); This returns json of the request and a 200 status. The nearest

Accessing G Suite Admin SDK using service account

允我心安 提交于 2019-12-30 10:54:47
问题 I am trying to use a service account to access Directory API (https://developers.google.com/admin-sdk/directory/v1/reference/users/list). The simplest task is to list users in the organization. That works well with my user account, tested with the OAuth 2.0 Playgorund. But I need to use service account. I am following documentation for two-legged OAuth (https://developers.google.com/identity/protocols/OAuth2ServiceAccount) and implementing REST client in Powershell API Access enabled in

Why Google direction and distance matrix API show different results for source and destination value

China☆狼群 提交于 2019-12-24 01:39:07
问题 I am trying to get distance and duration using google direction API https://maps.googleapis.com/maps/api/directions/json?origins=latitude,longitude&destinations=latitude,longitude&&mode=driving&key=xxxxxxxxxxxxxxxxxxxxx and its working fine and get the distance and duration like this distance="30 m" duration="1 min" when am trying get distance and duration using distancematrix api, https://maps.googleapis.com/maps/api/distancematrix/json?origins=latitude,longitude&destinations=latitude

Google Admin Directory API: Add User Employee Details

拟墨画扇 提交于 2019-12-23 02:42:09
问题 I already have a working function for adding user using Google Admin Directory: string password = Random_Password(); User newuserbody = new User(); UserName newusername = new UserName(); UserOrganization newuserorg = new UserOrganization(); newusername.GivenName = GivenName; newusername.FamilyName = FamilyName; newuserbody.Name = newusername; newuserorg.Department = Department; newuserorg.CostCenter = Country; newuserorg.Title = JobTitle; newuserbody.Organizations = newuserorg; newuserbody

How to use GTMAppAuth in Swift

一笑奈何 提交于 2019-12-22 08:55:30
问题 I do not know how to code in Objective-C and have to get an app working with the G Suite SDK so that I can get information about members of the groups. The problem is that in September Google changed how auth requests work, so this tutorial no longer works. I know I need to switch over to using GTMAppAuth, but it's all Objective-C. 回答1: I am currently working on YouTube Data API and trying to implement functions in Swift. The following is what I did: Install GTMAppAuth using Cocoapods. Add