API - add refresh token

This commit is contained in:
Sam
2022-05-27 14:18:50 +02:00
parent 64b813a44b
commit 887553dd5d
5 changed files with 10 additions and 4 deletions

View File

@ -19,7 +19,7 @@ def create_oauth_client(metadata: Dict, user: User) -> OAuth2Client:
'client_uri': metadata['client_uri'],
'redirect_uris': metadata['redirect_uris'],
'scope': metadata['scope'],
'grant_types': ['authorization_code'],
'grant_types': ['authorization_code', 'refresh_token'],
'response_types': ['code'],
'token_endpoint_auth_method': 'client_secret_post',
}

View File

@ -1,7 +1,7 @@
from authlib.oauth2.rfc7636 import CodeChallenge
from flask import Flask
from .grants import AuthorizationCodeGrant
from .grants import AuthorizationCodeGrant, RefreshTokenGrant
from .server import authorization_server
@ -12,3 +12,4 @@ def config_oauth(app: Flask) -> None:
authorization_server.register_grant(
AuthorizationCodeGrant, [CodeChallenge(required=True)]
)
authorization_server.register_grant(RefreshTokenGrant)