FitTrackee/fittrackee/oauth2/config.py
2022-05-29 14:23:29 +02:00

16 lines
449 B
Python

from authlib.oauth2.rfc7636 import CodeChallenge
from flask import Flask
from .grants import AuthorizationCodeGrant, RefreshTokenGrant
from .server import authorization_server
def config_oauth(app: Flask) -> None:
authorization_server.init_app(app)
# supported grants
authorization_server.register_grant(
AuthorizationCodeGrant, [CodeChallenge(required=True)]
)
authorization_server.register_grant(RefreshTokenGrant)