google-admin-sdk

TokenResponseException: 401 Unauthorized Exception when trying to access Admin SDK Google API.

人走茶凉 提交于 2019-12-04 06:42:22
问题 I am trying to do an extract of users in my domain by accessing the Google Admin SDK API. I am however given a 401 unauthorized exception. The code below is my settings class that contains my method to call the API. package com.brookfieldres.operations; import java.io.File; import java.io.IOException; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.ResourceBundle; import org.apache.log4j.Logger; import com.brookfieldres.common.Constants; import com

How can I retrieve the CustomerId from a using Google API calls from a NonAdmin user?

左心房为你撑大大i 提交于 2019-12-04 05:40:18
问题 I'm trying to retrieve the 'customerId' value for a Non-Admin user on a Google Apps Enterprise. As a non-admin there are a lot of APIs I won't have access to. Is there any way for me to retrieve the 'customerId' for my account? 回答1: The customerId is identical for all users in the Google Apps instance (including users in other secondary domains). If you're working with a single Google Apps instance, the customerId is static and thus once discovering it from an admin account, you can hard code

Using Argparse with Google Admin API

我们两清 提交于 2019-12-04 04:28:14
问题 I am using Google's Python API to pull down auditing information, but I can't get the parent group arguments for argparse (which appear to be required for API access) and my own arguments (e.g. passing in a date) to work together. Code: import pprint import sys import re import httplib2 import json import collections import argparse from oauth2client import client from apiclient import sample_tools from apiclient import discovery from oauth2client.client import AccessTokenRefreshError from

Admin SDK cannot set settings for Firestore

我的梦境 提交于 2019-12-04 02:15:13
So, I've been getting this warning recently: The behavior for Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK. To hide this warning and ensure your app does not break, you need to add the following code to your app before calling any other Cloud Firestore methods: const firestore = new Firestore(); const settings = {/* your settings... */ timestampsInSnapshots: true}; firestore.settings(settings); With this change, timestamps stored in Cloud Firestore will be read back as Firebase Timestamp objects instead of as system Date objects. So you will also need to update

Listing Password complexity Google Admin SDK

自闭症网瘾萝莉.ら 提交于 2019-12-03 21:50:43
From the Google Admin panel there is a nice password strength meter and password length feature. From the admin panel go to Security >> Password Monitoring. Is there a programatic way of getting this info exported in a report? There is not. The Admin SDK Directory and Reports APIs do not return any information on password complexity / strength. 来源: https://stackoverflow.com/questions/31148889/listing-password-complexity-google-admin-sdk

What privileges are required to call the directory.user.update api?

笑着哭i 提交于 2019-12-03 21:28:13
Our organization uses SAML for SSO into Google Apps. In order to use SSO we must manage the change password functionality through APIs. Since the Provisioning API has been deprecated in favor of the Admin SDK Directory API, I am developing against this API. The flow I am developing is that the end user will login using Google OAuth2 into my application. Then, using the users access token I am attempting to call the https://www.googleapis.com/admin/directory/v1/users/ API to put a new password, but I get an error 403 "Not Authorized to access this resource/api". My question is, what privilege

How to get a CustomerId (or other primary key) for a Google Apps account?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 17:13:45
When a user logs on to our Marketplace V2 app, we need to know which Google Apps account the user belongs to. The id_token contains the 'hd' parameter (the domain name), but that's not enough, as a Google Apps account can have multiple domains. CustomerId seems like a good primary key to match users to the correct Google Apps account. The problem is, it doesn't seem to be included in the id_token. Is there some way to figure out what the CustomerId of a user is. The Admin SDK would be one option, but in almost all cases, calls to the Admin SDK fail with "Domain cannot use APIs". I read in a

Login Required 401 using Google ServiceAccountCredential using Google Admin Directory API

孤街醉人 提交于 2019-12-02 16:19:46
问题 I have tried to follow the simple example listed here: https://developers.google.com/admin-sdk/directory/v1/quickstart/dotnet The difference is I generated a Service Account Credential, and assigned it as a Delegate with the Role Project Owner, so it has full access. I also assigned it the proper namespaces for scopes. Here it has access to orgunits which is what I'm trying to list in the Directory API Here is my service account defined Here are my credentials I downloaded the JSON for the

Google Admin sdk directory 403

僤鯓⒐⒋嵵緔 提交于 2019-12-02 14:08:55
问题 I'm trying to use googleapi 2.0 with service account to use Directory gooogle admin sdk on user on an entrprise domain. I've proceeded as suggested (this for instance) and prepared a "wish to work" poc java code. Somthing like this... package com.mc3info.google.api20.test; import java.io.File; import java.security.NoSuchAlgorithmException; import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.Arrays; import

TokenResponseException: 401 Unauthorized Exception when trying to access Admin SDK Google API.

醉酒当歌 提交于 2019-12-02 11:43:58
I am trying to do an extract of users in my domain by accessing the Google Admin SDK API. I am however given a 401 unauthorized exception. The code below is my settings class that contains my method to call the API. package com.brookfieldres.operations; import java.io.File; import java.io.IOException; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.ResourceBundle; import org.apache.log4j.Logger; import com.brookfieldres.common.Constants; import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.auth