Posts

Showing posts with the label google app

Using SimpleSAMLphp to authenticate users in Google Apps with Active Directory

To let my users login to Google Apps using Active Directory accounts, I can use SimpleSAMLphp as an IdP which gets identities from my Active Directory servers. Things are pretty easy with simplesamlphp, of-course: 1.  SimpleSAMLphp configurations: simplesamlphp/config/authsources.php : simplesamlphp/config/config.php : simplesamlphp/www/logout_relay.php : (because Google does not allow log out URLs that have question mark and parameters) 2. Google App settings: >> Go to https://admin.google.com and login as my Google App administrator account. >> Security -> Advanced Settings -> Setup Single Sign-on (SSO) : + Check "Enable Single Sign-on" + Sign-in page URL * https://mydomain.com/simplesaml/saml2/idp/SSOService.php + Sign-out page URL * https://mydomain.com/simplesaml/logout_relay.php + Change password URL * https://mydomain.com/ >> Click " Save changes " 3. NGINX server block for simplesamlphp: ...

Google SMTP Error: 454 4.7.0

This morning, I tried to send around 1/2 thousand of emails using an Google App Email account from my Django app along with celery and django-mailer . But after 100 messages were sent, the celery task cannot send email, and I got this error: Google SMTP Error: 454 4.7.0 Too many login attempts, please try again later There are something I need to do to solve this: 1. Add a DKIM record in Google Apps: following this stackoverflow question: http://serverfault.com/questions/543007/google-smtp-error-454-4-7-0-too-many-login-attempts-please-try-again-later In order to add a DKIM record in Google Apps, you need to do the following: Go to the Admin Console Click on "Google Apps" Click on "Gmail" Scroll down until you see "Authenticate Email" and click that Select the domain you wish to add DKIM to When it asks what prefix you want to use, simply use the default of 'google' You will then see a TXT record in two parts, one piece has...

Google Email Settings API - Enable IMAP for all users in your domain

I wrote the following python script to enable IMAP for all users in my Google App domain: #! /usr/bin/env python import gdata.apps.emailsettings.client from gdata.client import BadAuthentication from gdata.client import RequestError import csv import socket if socket.gethostname() in ['trinh-pc',]: # add your hostname here     from settings_local import * else:     from settings import * import sys DOMAIN = 'mydomain.com' DOMAIN_ADMIN = 'domain_admin_username' DOMAIN_ADMIN_P = 'domain_admin_password' def get_username_list_from_text (username_file_path):     # username_list = []     text_file = open(username_file_path, 'rb')     username_list = text_file.read()     text_file.close()     username_list = username_list.split('\n')     return username_list def create_gdata_client (domain, admin_email, admin_password, appname='GEM'):     try:  ...

Google Drive API - Feeling the openness of Google

I'm currently working on a project that need to migrate all my organization documents (of all users) which hosted on Google App to a new domain (also on Google App) So, the process is: 1. Using a Service Account of the old domain to read all files and folders of all user in the old domain along with their current sharing permissions. 2. For each file / folder, share with the relevant new accounts in the new domain. 3. In the new domain, make a copy of each shared file / folder by another Service Account of this new domain. 4. Apply the old sharing permissions to the same file in the new domain. 5. In the old domain, remove shared permissions to new domain accounts. Service Account is a special account used by the application (this) with the domain-wide privileges. It can manipulate all files and folders of all accounts in the domain. ( https://developers.google.com/drive/delegation ) I've just played around with the api documentations and have some utility func...