aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authentication/oauth2/server.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-05-09 08:06:38 +0300
committerFrederick Muriuki Muriithi2024-05-13 06:16:34 +0300
commit0aa19052d00b2e7d0d6edd5905314484480e7ea2 (patch)
tree972c36a5896bf15a1b39ca6190d56794f9aea7c8 /gn_auth/auth/authentication/oauth2/server.py
parent2fce987d86a25db77e95b1a50b244b5a58cce30a (diff)
downloadgn-auth-0aa19052d00b2e7d0d6edd5905314484480e7ea2.tar.gz
Register the RefreshTokenGrant with the server
Register the RefreshTokenGrant with the server to enable refreshing of the tokens.
Diffstat (limited to 'gn_auth/auth/authentication/oauth2/server.py')
-rw-r--r--gn_auth/auth/authentication/oauth2/server.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/gn_auth/auth/authentication/oauth2/server.py b/gn_auth/auth/authentication/oauth2/server.py
index 70a0e51..8b65aa9 100644
--- a/gn_auth/auth/authentication/oauth2/server.py
+++ b/gn_auth/auth/authentication/oauth2/server.py
@@ -16,6 +16,7 @@ from .models.oauth2token import OAuth2Token, save_token
from .models.jwtrefreshtoken import JWTRefreshToken, save_refresh_token
from .grants.password_grant import PasswordGrant
+from .grants.refresh_token_grant import RefreshTokenGrant
from .grants.authorisation_code_grant import AuthorisationCodeGrant
from .grants.jwt_bearer_grant import JWTBearerGrant, JWTBearerTokenGenerator
@@ -83,6 +84,7 @@ def setup_oauth2_server(app: Flask) -> None:
server.register_token_generator(
"urn:ietf:params:oauth:grant-type:jwt-bearer",
JWTBearerTokenGenerator(app.config["SSL_PRIVATE_KEY"]))
+ server.register_grant(RefreshTokenGrant)
# register endpoints
server.register_endpoint(RevocationEndpoint)