Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
OAuth2 AccessType RefreshToken
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Simon Berthiaume  
View profile  
 More options Sep 13 2012, 2:09 pm
From: Simon Berthiaume <sberthia...@acquisio.com>
Date: Thu, 13 Sep 2012 11:09:11 -0700 (PDT)
Local: Thurs, Sep 13 2012 2:09 pm
Subject: OAuth2 AccessType RefreshToken

Hi, we recently started using the OAuth2 Java API in order to migrate from
GoogleAnalytics v2 API to v3. However, I just discovered that we never
explicitly requested offline access as part of our process:
        new GoogleAuthorizationCodeRequestUrl(CLIENT_ID, AUTH_URL,
serviceScopes)
                        .setState(state)
                        .build();

However, we do receive refresh tokens when validating the authorization
code:
        GoogleTokenResponse response = new
GoogleAuthorizationCodeTokenRequest(netHttpTransport, jacksonFactory,
                            CLIENT_ID, CLIENT_SECRET, authCode,
AUTH_URL).execute();
        response.getRefreshToken(); //Not null

Although I plan to fix the code for the offline access for future use,
should we re-request new refresh-tokens, do they risk becoming invalid in
any way the way they were created? With some of our tokens, we sometimes
receive "invalid_grant" errors, but not all of them, could it be related or
does it just mean the client revoked access? I though the fact that we do
receive refresh-token indicated that we were granted offline access.

If it can have any impact our application is registered as an "Installed"
application.

Thanks for any details/reassurance you could provide.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
יניב ענבר Yaniv Inbar  
View profile  
 More options Sep 14 2012, 7:40 am
From: Yaniv Inbar (יניב ענבר) <yan...@google.com>
Date: Fri, 14 Sep 2012 07:40:00 -0400
Subject: Re: OAuth2 AccessType RefreshToken

By default installed apps receive offline access (whereas web apps by
default get online access).  I've recently updated the JavaDoc to specify
that, whereas previously the JavaDoc said online access is always the
default which is incorrect.

So the good news is that if you have a refresh token you are all set, you
do indeed have offline access, and don't need to re-request new refresh
tokens.

I don't know why you are sometimes getting "invalid_grant" errors.  Those
can be tricky to debug.

And yes, there is a maximum # of refresh tokens the same application can
have with the same account.  As far as I know this is not documented
anywhere, but it is in the order of 10s of refresh tokens.  After a certain
# they simply invalidate the old ones.  So it is very important that if you
are using refresh tokens that you store them in a persistent store.

-- Yaniv


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Berthiaume  
View profile  
 More options Sep 14 2012, 7:53 am
From: Simon Berthiaume <sberthia...@acquisio.com>
Date: Fri, 14 Sep 2012 04:53:24 -0700 (PDT)
Local: Fri, Sep 14 2012 7:53 am
Subject: Re: OAuth2 AccessType RefreshToken

Thanks for the good news.

As for the number of tokens, we do persist the tokens, the problem is we
allow the same GA account to be "added" multiple times and each had their
own token; I'm not too worried about that one, it shouldn't be too hard to
fix.

Thanks for the very fast answer and if it can help document the "feature",
from the empirical evidence I gathered, the number of refresh tokens would
be around 20  ;)

Simon B.

On Friday, September 14, 2012 7:40:01 AM UTC-4, יניב ענבר Yaniv Inbar wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shweta  
View profile  
 More options Oct 10 2012, 7:38 am
From: Shweta <tanna.shw...@gmail.com>
Date: Wed, 10 Oct 2012 04:38:32 -0700 (PDT)
Local: Wed, Oct 10 2012 7:38 am
Subject: Re: OAuth2 AccessType RefreshToken

Hi Yaniv,

Can you please provide proper steps to use Url shortner API with google app
engine.
I really can't understand about "API key" and AuthToken.
I have used your sample code for URL Shortner using java.
But I am getting this error :
"

com.google.api.client.googleapis.json.GoogleJsonResponseException: 401

{
  "code" : 401,
  "errors" : [ {
    "domain" : "global",
    "location" : "Authorization",
    "locationType" : "header",
    "message" : "Invalid Credentials",
    "reason" : "authError"
  } ],
  "message" : "Invalid Credentials"

}

"
Kindly help.

Regards,
Shweta tanna

On Friday, September 14, 2012 5:10:01 PM UTC+5:30, יניב ענבר Yaniv Inbar
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic