update refresh token time
This commit is contained in:
@@ -38,6 +38,12 @@ private_key = read_file_path('private.pem')
|
||||
private_jwk = JsonWebKey.import_key(private_key)
|
||||
|
||||
|
||||
GRANT_TYPES_EXPIRES_IN = {
|
||||
'authorization_code': 60 * 3, # 3 minutes
|
||||
'refresh_token': 3600, # 1 hour
|
||||
}
|
||||
|
||||
|
||||
class OpenIDCode(OpenIDCode_):
|
||||
def exists_nonce(self, nonce: str, request: OAuth2Request) -> bool:
|
||||
if not request.payload:
|
||||
@@ -54,7 +60,7 @@ class OpenIDCode(OpenIDCode_):
|
||||
'key': private_key,
|
||||
'alg': 'RS256',
|
||||
'iss': ISSUER,
|
||||
'exp': 3600,
|
||||
'exp': 3600, # 1 hour
|
||||
}
|
||||
|
||||
def generate_user_info(self, user: User, scope: str) -> UserInfo:
|
||||
@@ -308,12 +314,6 @@ class IssuerParameter(rfc9207.IssuerParameter):
|
||||
return ISSUER
|
||||
|
||||
|
||||
GRANT_TYPES_EXPIRES_IN = {
|
||||
'authorization_code': 60 * 3, # 3 minutes
|
||||
'refresh_token': 60 * 30, # 30 minutes
|
||||
}
|
||||
|
||||
|
||||
def expires_in(client, grant_type: str) -> int:
|
||||
return GRANT_TYPES_EXPIRES_IN.get(
|
||||
grant_type, BearerTokenGenerator.DEFAULT_EXPIRES_IN
|
||||
|
||||
Reference in New Issue
Block a user