The refresh_token is only provided on the first authorization from the user. Subsequent authorizations, such as the kind you make while testing an OAuth2 integration, will not return the refresh_token again.
but
requestServerAuthCode(String serverClientId)
复制代码
替换成
requestServerAuthCode(String serverClientId, boolean forceCodeForRefreshToken)
复制代码
you can get refresh_token every time.