gpt4 book ai didi

oauth - GitLab OAuth 访问 token 有效性

转载 作者:行者123 更新时间:2023-12-03 22:39:24 27 4
gpt4 key购买 nike

有谁知道 GitLab 上 OAuth 访问 token 的有效期是多少?

至少需要 12 小时(根据经验),但我想确定一下,所以我不会不必要地刷新 token 。

PS:亚搏体育app ...如果在获取/刷新 token 时简单地返回到期时间会非常方便(PS:文档指出“expires_in”:返回......但它不是)

最佳答案

来自 https://forum.gitlab.com/t/missing-expires-in-in-the-token-response/1232/2 :

Gitlab uses Doorkeeper for oauth.

The Doorkeeper wiki has an ariticle "Customizing Token Expiration" > https://github.com/doorkeeper-gem/doorkeeper/wiki/Customizing-Token-Expiration2

This wiki tells us a configuration "access_token_expires_in". I > searched in gitlab source code and found it sets to nil.

This meas the 'access_token' will never expire.


另外,这是来自 https://gitlab.com/gitlab-org/gitlab-foss/-/blob/50d66f5ece57dcfbe074d97703691a8d3c38f4ac/config/initializers/doorkeeper.rb#L42 :
 # Access token expiration time (default 2 hours).
# If you want to disable expiration, set this to nil.
access_token_expires_in nil

关于oauth - GitLab OAuth 访问 token 有效性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39264452/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com