Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The new Admin SDK Directory and Reports APIs support OAuth 1.0 authentication including 2-legged OAuth. However, the Google API Python Client library has <a href="https://groups.google.com/d/msg/google-api-python-client/trwf_yS1p0s/eT18tzCisdkJ" rel="nofollow">removed OAuth 1.0 support</a>.</p> <p>If possible, you should upgrade to OAuth 2.0 and (possibly) <a href="https://developers.google.com/accounts/docs/OAuth2ServiceAccount" rel="nofollow">Service Accounts</a> (2-legged replacement) for your application.</p> <p>I did have a Apps Marketplace App that I wanted to use the Directory API with but marketplace is still 2-legged OAuth only. I managed to get the Directory API working with 2-legged using the gdata library to authenticate and low level POST / GET library calls. A quick example:</p> <p>Get user in Google Apps using 2LO, Admin API and old GData library:</p> <pre><code>gapps = gdata.client.GDClient() gapps.ssl = True gapps.auth_token = gdata.gauth.TwoLeggedOAuthHmacToken(two_legged.key, two_legged.secret, user_email) uri = 'https://www.googleapis.com/admin/directory/v1/users/%s' % user_email user_results = gapps.request(method='GET', uri=uri) user_json = json.loads(user_results.read()) </code></pre> <p>A better way to do this might be to utilize the old GData library to generate the needed 2-legged OAuth headers, then rip those headers out and stick them into discovery objects generated by the new Google API library but I've not yet worked out wha that would look like, shouldn't be terribly hard though.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload