API - init OAuth server and oauth clients creation
This commit is contained in:
14
fittrackee/oauth2/config.py
Normal file
14
fittrackee/oauth2/config.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from authlib.oauth2.rfc7636 import CodeChallenge
|
||||
from flask import Flask
|
||||
|
||||
from .grants import AuthorizationCodeGrant
|
||||
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)]
|
||||
)
|
||||
Reference in New Issue
Block a user