aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authentication/oauth2/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/auth/authentication/oauth2/server.py')
-rw-r--r--gn_auth/auth/authentication/oauth2/server.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gn_auth/auth/authentication/oauth2/server.py b/gn_auth/auth/authentication/oauth2/server.py
index 0bce3d3..09a3449 100644
--- a/gn_auth/auth/authentication/oauth2/server.py
+++ b/gn_auth/auth/authentication/oauth2/server.py
@@ -14,6 +14,7 @@ from .models.oauth2token import OAuth2Token, save_token
from .grants.password_grant import PasswordGrant
from .grants.authorisation_code_grant import AuthorisationCodeGrant
+from .grants.jwt_bearer_grant import JWTBearerGrant, JWTBearerTokenGenerator
from .endpoints.revocation import RevocationEndpoint
from .endpoints.introspection import IntrospectionEndpoint
@@ -59,6 +60,11 @@ def setup_oauth2_server(app: Flask) -> None:
# below
server.register_grant(AuthorisationCodeGrant)
+ server.register_grant(JWTBearerGrant)
+ server.register_token_generator(
+ "urn:ietf:params:oauth:grant-type:jwt-bearer",
+ JWTBearerTokenGenerator(app.config["JWT_PRIVATE_KEY"]))
+
# register endpoints
server.register_endpoint(RevocationEndpoint)
server.register_endpoint(IntrospectionEndpoint)