Provisioning 401 Eror

47 views
Skip to first unread message

Darin Lampson

unread,
Oct 18, 2011, 4:49:23 PM10/18/11
to google-app...@googlegroups.com
Hello,

I am using OAuth Playground, to test get all users via https://apps-apis.google.com/a/feeds/{domain}.com/user/2.0 and get the 401 unknown authorization header.  I am using the OAuth key and secret in my dashboard and I have enabled access the API.  Any ideas?

Thanks

GET /a/feeds/{domain}.com/user/2.0 HTTP/1.1
Host: apps-apis.google.com
Accept: */*
Authorization: OAuth oauth_version="1.0", oauth_nonce="999ed576cbd4863f1c119dbd0ce5d444", oauth_timestamp="1318970490", oauth_consumer_key="{key}", oauth_signature_method="HMAC-SHA1", oauth_signature="fjCnhLWwYBFUSn3b1iMhWkNtd1I%3D"Content-Type: application/atom+xml
GData-Version: 2.0

HTTP/1.1 401 Unknown authorization header
WWW-Authenticate: GoogleLogin realm="http://www.google.com/accounts/ClientLogin", service="apps"
Content-Type: text/html; charset=UTF-8
Date: Tue, 18 Oct 2011 20:41:30 GMT
Expires: Tue, 18 Oct 2011 20:41:30 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Transfer-Encoding: chunked

<?xml version="1.0"?>
<HTML>
  <HEAD>
    <TITLE>Unknown authorization header</TITLE>
  </HEAD>
  <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <H1>Unknown authorization header</H1>
    <H2>Error 401</H2>
  </BODY>
</HTML>

Gunjan Sharma

unread,
Oct 19, 2011, 1:20:06 AM10/19/11
to google-app...@googlegroups.com
Hi Darin

What scope did you choose for the User Provisioning? It should be https://apps-apis.google.com/a/feeds/user/

Thanks
Gunjan Sharma | Developer Programs Engineer |  gunjan...@google.com |  +91 7702534446



--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/HKg6y0vd37MJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Lucas Lacroix

unread,
Oct 19, 2011, 9:21:29 AM10/19/11
to Google Apps Domain Information and Management APIs

You cannot use the OAuth key and Secret from your domain's dashboard
to access user profiles. The only exception is if you explicitly grant
the application READ-ONLY access, which means you would need to
uncheck "Allow Access to All APIs" and then define all the APIs you
want to have access to.

I just went through this with my own domain. You can use the
ClientLogin authentication or your can use OAuth with an application
key and secret.

On Oct 18, 4:49 pm, Darin Lampson <da...@solventtek.com> wrote:
> Hello,
>
> I am using OAuth Playground, to test get all users
> viahttps://apps-apis.google.com/a/feeds/{domain}.com/user/2.0 and get the

Gunjan Sharma

unread,
Oct 19, 2011, 10:33:02 AM10/19/11
to google-app...@googlegroups.com
Hello Darin, Lucas

It is possible to retrieve users using your own domain's secret and key. You need not even uncheck "Allow Access to All APIs".
Using OAuth playground follow this steps.
2. choose HMAC-SHA1 as the oauth_signature_method
3. fill your domain's key and secret at the respective places
4. Go through the GET token procedure by pressing the buttons in order
5. After getting the access token put  https://apps-apis.google.com/a/feeds/{domain}.com/user/2.0 in "Use the token" text box and replace domain by your domain name and make sure you are making  a get request.
6. press execute

Thanks
Gunjan Sharma |  Developer Programs Engineer | gunjan...@google.com |  +91 7702534446



--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
Reply all
Reply to author
Forward
0 new messages