Hi Pedro,

It looks like your code is not setting the scope for the OAuth request.
The correct scope to set is in the documentation:

http://code.google.com/googleapps/domain/gdata_provisioning_api_v2.0_developers_protocol.html#3LO_Tokens

Claudio

On Thu, May 12, 2011 at 3:03 PM, Pedro Ferreira <[email protected]> wrote:

>  Claudio,
>
> any news?
>
> Thanks!
>
> Pedro
>
> Em 12-05-2011 08:00, Pedro Ferreira escreveu:
>
> Claudio,
>
> the user is admin.
>
> The code is below:
>
>
> String loginname,logindomain;
>         String selectedlogin;
>         String accesstoken;
>         String accesstokensecret;
>
>         String[] result = null;
>         String[] arr_user;
>         String str_domain;
>
>         selectedlogin = session.getAttribute("selectedlogin").toString();
>         accesstoken = session.getAttribute("login_" + selectedlogin +
> "_accesstoken").toString();
>         accesstokensecret = session.getAttribute("login_" +
> selectedlogin + "_accesstokensecret").toString();
>         loginname = session.getAttribute("login_" + selectedlogin +
> "_loginname").toString();
>         arr_user = loginname.split("@");
>         str_domain = arr_user[1];
>
>         String CONSUMER_KEY = "www.egypteam.com";
>         String CONSUMER_SECRET = "qnmr5nZMTIfSKK+dqAoD8TKN";
>         String ACCESS_TOKEN =
> session.getAttribute("accesstoken").toString();
>         String TOKEN_SECRET =
> session.getAttribute("accesstokensecret").toString();
>
>         GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
>         oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
>         oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
>         oauthParameters.setOAuthToken(ACCESS_TOKEN);
>         oauthParameters.setOAuthTokenSecret(TOKEN_SECRET);
>
>         UserService obj_us = new UserService(application_name);
>         obj_us.useSsl();
>         obj_us.setOAuthCredentials(oauthParameters, new
> OAuthHmacSha1Signer());
>
>         URL feedURL = new URL("https://apps-apis.google.com/a/feeds/"; 
> <https://apps-apis.google.com/a/feeds/> +
> str_domain + "/user/2.0");
>         UserFeed resultFeed = obj_us.getFeed(feedURL, UserFeed.class);
>
>         for (UserEntry entry : resultFeed.getEntries()) {
>             println("[" + entry.getEmail() + "]<br />");
>         }
>
>         return result;
>
>
>
>
>
>
>
>
> Em 12-05-2011 03:42, Claudio Cherubino escreveu:
>
>  Pedro,
>
> Can you show us your code?
> Is the user an admin for the domain?
> Thanks
>
> Claudio
>
> On Wed, May 11, 2011 at 2:52 PM, Pedro Ferreira <[email protected]> 
> <[email protected]> wrote:
>
>
>   Claudio,
>
> it's the user provisioning API.
>
> The problem is when accessing user Provisioning API using oauth 3-legged to
> list users, I get the following error message:
>
> com.google.gdata.util.AuthenticationException: Token invalid - AuthSub
> token has wrong scope Token invalid - AuthSub token has wrong scope Error
> 401
> I saw that some people are experiencing the same error, in this forum.
>
> Thanks,
>
> Pedro
>
> Em 11-05-2011 18:07, Claudio Cherubino escreveu:
>
> Hi Pedro,
>
> What is the problem you are experiencing now?
> Please note that if your issue is related to the Documents List API this is
> not the correct forum. In that case, please post your question at:
> http://code.google.com/apis/documents/forum.html
>
> Thanks
> Claudio
>
> On Wed, May 11, 2011 at 1:55 PM, Pedro Ferreira <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> wrote:
>
>
>   Hi Claudio!
>
> Now i am using an Business edition.
>
> Could you help me with this problem?
>
> Thanks!
>
> Em 02-05-2011 06:34, Claudio Cherubino escreveu:
>
> All Google Apps Domain Information & Management APIs are listed at the
> following page, together with the supported domain 
> editions:http://code.google.com/googleapps/docs/#domain
>
>
> Claudio
>
> On Sun, May 1, 2011 at 9:51 PM, Pedro Ferreira <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> wrote:
>
>
>   Hi Claudio!
>
> And about a document feed url that returns all documents from all users?
>
> Like:https://docs.google.com/feeds/-/private/full
>
> ORhttps://docs.google.com/feeds/all/private/full
>
>
> Is there anything like that?
>
> Thanks,
>
> Pedro
>
> Em 01-05-2011 16:18, Claudio Cherubino escreveu:
>
> Unfortunately all Domain Management APIs require a Google Apps for Business
> or Education edition domain.
>
> Claudio
>
> On Sun, May 1, 2011 at 8:16 PM, Pedro Ferreira <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> wrote:
>
>
>   Claudio,
>
> Is there another way to list users?
>
> Thanks!
>
> Pedro.
>
> Em 01-05-2011 15:58, Claudio Cherubino escreveu:
>
> Pedro,
>
> The Provisioning API can only be used with Google Apps for Business or
> Education edition domains, not Standard.
>
> Claudio
>
> On Sun, May 1, 2011 at 7:50 PM, Pedro Ferreira <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <
> [email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> wrote:
>
>
>   Claudio,
>
> It's not there..
>
> The edition is Standard
>
> Em 01-05-2011 15:38, Claudio Cherubino escreveu:
>
> Pedro,
>
> In the Advanced Tools tab of your domain control panel there should be a
> link called "Manage third party OAuth Client access" in the Authentication
> section.
> If it's not there, can you tell me what is the edition of your Google Apps
> domain?
> Thanks
>
> Claudio
>
> On Sun, May 1, 2011 at 7:36 PM, Pedro Ferreira <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <
> [email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> wrote:
>
>
>   Claudio,
>
> my panel is in English and with Next Generation enabled.
>
> Thanks,
>
> Pedro
>
> Em 01-05-2011 15:30, Pedro Ferreira escreveu:
>
> Claudio,
>
> I can't see this 
> section:http://www.google.com/support/a/bin/answer.py?answer=162106
>
>
>
>
>
> (Managing API client access)
>
> in my Domain Configuration.
>
> It's a part of the tutorial you wrote.
>
> Do you know the reason?
>
> Thanks,
>
> Pedro
>
> Em 01-05-2011 15:01, Claudio Cherubino escreveu:
>
>  Hi Pedro,
>
> The Provisioning API supports 3-legged OAuth for authentication but at the
> moment I don't have a sample Java code to show you.
> We recently wrote an article on how to use the Provisioning API with OAuth
> (both 3LO and 2LO), however the code sample is in 
> Python:http://code.google.com/googleapps/domain/articles/provisioningoauth.html
>
>
>
>
>
>
>
>
> Hope it helps
>
> Claudio
>
> On Sun, May 1, 2011 at 1:09 PM, Pedro Ferreira <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <
> [email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]>
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> <[email protected]> <[email protected]> 
> <[email protected]> wrote:
>
>
>  Hi there,
>
> I'd like to know if it's possible to use User Provisioning API through
> 3-legged Auth.
>
> My problem is:
>
> I usually use the AppsForYourDomainClient class to access this API, like
> below:
>
> AppsForYourDomainClient upclient = new
> AppsForYourDomainClient(str_admin_user,str_admin_password, str_domain);
>
> But I would like to use a 3-legged OAuth token to use the API (my
> application redirects to google login page, and after logged, user gets back
> to application. Therefore, my app doesn't have user password.
>
> Thanks,
>
> Pedro
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email [email protected].
> To unsubscribe from this group, send email 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>
>
>    --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email [email protected].
> To unsubscribe from this group, send email 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>
>
>    --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email [email protected].
> To unsubscribe from this group, send email 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>
>
>    --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email [email protected]
>
> .
> To unsubscribe from this group, send email 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>
>
>    --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email [email protected].
> To unsubscribe from this group, send email 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>
>
>    --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email [email protected]
> .
> To unsubscribe from this group, send email 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>
>
>    --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email [email protected].
> To unsubscribe from this group, send email 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>
>
>    --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Apps Domain Information and Management APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Reply via email to