简体   繁体   English

google返回的code参数的有效期限是多长?

[英]What is the expiry time of the code parameter returned by google?

I am integrating google calendar api, I have a url that is the redirect url after the application access is authenticated, the url returns a parameter code like 我正在集成google calendar API,我有一个网址,该网址是经过身份验证的应用程序访问后的重定向网址,该网址返回的参数代码如下

redirectUrl/code?='somecode' redirectUrl / code?='somecode'

i want to know the time expiry for the parameter code 我想知道参数代码的到期时间

The default is 3600 seconds, or an hour. 默认值为3600秒或一个小时。 But if you make requests after that, the previous code will be invalid, but I'm sure you know that. 但是,如果之后发出请求,则先前的代码将无效,但是我确定您知道这一点。

https://developers.google.com/accounts/docs/OAuth2UserAgent#handlingtheresponse https://developers.google.com/accounts/docs/OAuth2UserAgent#handlingtheresponse

The expiry of the access token is 3600 seconds only. 访问令牌的有效期仅为3600秒。
it could be revoked using refresh token or the access token it self, you may use the refresh token if the approval prompt for the google approval is kept "auto", but in the case you would get refresh token only once, using refresh token the response does not returns refresh token in this case but if you will use access token refresh token shall be generated with it, but if you use approval prompt of "force" type then you shall get the approval window every time. 可以使用刷新令牌或自身的访问令牌撤销它,如果Google批准的批准提示保持为“自动”,则可以使用刷新令牌,但在这种情况下,使用刷新令牌只能获得一次刷新令牌。在这种情况下,response不返回刷新令牌,但是如果您将使用访问令牌,则将生成刷新令牌,但是如果您使用“ force”类型的批准提示,则每次都会获得批准窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM