Google Cloud Print: How long is the token good for (to submit jobs to cloud print)?
Asked Answered
C

1

3

If my user uses oauth v2 to cloud print to get a credential, how do I get a credential that is good for at least 48 hours?

We need to be able to get access to the printer, and keep it for some days. (Conceivably we could require the user to re auth to google once or twice a week, but certainly not more.)

If google cloud print can't do this, what system can? (Require cross platform printing, from cloud to win, osx and linux, also require ability to do raw printing to local printer, not just print driver printing.)

Thanks!

Campestral answered 21/3, 2013 at 1:57 Comment(0)
R
6

There are two types of "credentials" in OAuth2 process: access token (its lifetime is short and determined by expires_in field of the OAuth2 server response) and refresh token which is virtually permanent unless user revokes granted access. When you possess refresh token you can get valid access token.

Refresh token is returned upon first auth request with parameter access_type=offline. All you need is to store obtained refresh token securely and use it to request for access token when necessary.

Read more in the document https://developers.google.com/accounts/docs/OAuth2WebServer

Roslyn answered 2/5, 2013 at 16:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.