google-admin-sdk

Google Python Admin SDK using Oauth2 for a Service Account (Education Edition)-“oauth2client.client.AccessTokenRefreshError: access_denied” exception

萝らか妹 提交于 2019-12-07 04:50:18
问题 I have been trying to get the Service Account authentication working for the Google Admin SDK for a few days now to no avail. I am using the google-api-python-client-1.2 library freshly installed from Google. I have been following Google's documentation on the topic. Links are here: htps://developers.google.com/accounts/docs/OAuth2ServiceAccount htps://developers.google.com/api-client-library/python/guide/aaa_oauth htp://google-api-python-client.googlecode.com/hg/docs/epy/oauth2client.client

Why is type of these User properties object: Addresses, Emails, Organizations, etc?

六眼飞鱼酱① 提交于 2019-12-06 14:58:35
问题 I am referring to the Google.Apis.Admin.Directory.directory_v1.Data.User type. The property type of Addresses , for example, in beta versions (i.e. 1.7 and older) was public virtual System.Collections.Generic.IList<UserAddress> Addresses { get; set; } In later versions (currently 1.9.1), they are all of type object. public virtual object Addresses { get; set; } What are the reasons behind the change and usage scenarios? I trawled the release notes, the web, google group, SO, etc. and found no

Create users using Service Account with Google Admin SDK?

人走茶凉 提交于 2019-12-06 14:27:47
问题 The documentation is a little unclear on this. Can I actually do this? The only examples I've seen so far are from the Google documentation that show it using the GoogleAuthorizationCodeFlow class to gain authorization. I've seen a few examples of using the Service Account to update and retrieve a list of users, but nothing for creating. Is this possible? If so, does anyone know of any examples floating around? I can't seem to find anything that addresses it. 回答1: You can follow the steps

Authenticating to Google API with OAuth2

穿精又带淫゛_ 提交于 2019-12-06 14:13:55
问题 I am trying out the sample code from Perform Google Apps Domain-wide Delegation of Authority using C# / .NET and, like in some other samples I have tried, the part of the code that creates an object that uses the auth variable says that they syntax is wrong. Here is the code I have: using System; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using DotNetOpenAuth.OAuth2; using Google.Apis.Authentication.OAuth2; using Google.Apis.Authentication.OAuth2

Admin SDK and 2 Legged Oauth

柔情痞子 提交于 2019-12-06 13:38:57
问题 Has anyone had any luck getting 2 Legged Oauth working with the Admin SDK and python? The only thing I can see in the docs at https://developers.google.com/admin-sdk/directory/v1/guides/authorizing about 2LO is the following: "If your application has certain unusual authorization requirements, such as logging in at the same time as requesting data access (hybrid) or domain-wide delegation of authority (2LO), then you cannot currently use OAuth 2.0 tokens. In such cases, you must instead use

AdminDirectory.Members.list Authorization error

落爺英雄遲暮 提交于 2019-12-06 07:37:46
I'm experimenting with Admin SDK and trying to list Group Members in a Google Spreadsheet. Here's the code I've come up with: function recordGroupsMembers() { var ss = SpreadsheetApp.getActiveSpreadsheet(); // Get all groups var groupPageToken, groupPage; do { groupPage = AdminDirectory.Groups.list({ domain: 'mydomain.com', maxResults: 100, pageToken: groupPageToken }); var groups = groupPage.groups; if (groups) { //Iterate groups for (var i in groups) { var group = groups[i]; //Get members of group var membersPageToken, membersPage; do { membersPage = AdminDirectory.Members.list(group, {

Retrieving Google User Photo

六眼飞鱼酱① 提交于 2019-12-06 03:42:49
I am able to retrieve the thumbnailPhotoUrl from the user.list api of the google admin SDK. However, whenever I try to render the image, Google is redirecting to a static silhouette image. The URL that is retrieved via the API looks like https://plus.google.com/_/focus/photos/private/AIbEiAIA.... As mentioned, this ends up getting redirected to: https://ssl.gstatic.com/s2/profiles/images/silhouette200.png However, with a little bit of reverse engineering, I can see the photo by adding /u/1/ to the beginning of the URL path, like this: https://plus.google.com/u/1/_/focus/photos/private/AIbEiAIA

What is the format for the Directory.users().list().setQuery method?

丶灬走出姿态 提交于 2019-12-05 22:54:01
The documentation states: Query string for prefix matching searches. Should be of the form "key":"value" where key can be "email", "firstName" or "lastName". I've tried: directory.users().list().setQuery("email:" + email).execute() directory.users().list().setQuery("\"email\":\"" + email + "\"").execute() directory.users().list().setQuery("email:\"" + email + "\"").execute() They all return a 400 : Bad Request response. How do I properly filter on the email address? Thank you! Currently the list API supports only prefix queries, please refer to the documentation for query parameter here . Try

Non-admin read-only access to Google Admin SDK

家住魔仙堡 提交于 2019-12-05 18:23:18
In a post on the Google Developers blog from September 23, 2014, it says: Read access to all domain users Historically, only admins have been able to access the data in the Admin SDK. Beginning today, any user (not just admins) will now be able to call the Directory API to read the profile of any user on the domain (of course, we will respect ACLing settings and profile sharing settings). However, despite checking every Google Apps Admin setting I can find, my calls calls to the Directory API fail for non-admin users. Condensed code: params = { client_id: XXXXXX, scope: 'https://www.googleapis

Admin SDK cannot set settings for Firestore

北战南征 提交于 2019-12-05 18:14:10
问题 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