Add JWT authentication support with login and refresh endpoints - #38
Open
rh-gvincent wants to merge 1 commit into
Open
Add JWT authentication support with login and refresh endpoints#38rh-gvincent wants to merge 1 commit into
rh-gvincent wants to merge 1 commit into
Conversation
fcharlier
reviewed
Apr 8, 2026
Implements JWT-based authentication using Flask-JWT-Extended with login and token refresh functionality. Access tokens expire after 1 hour while refresh tokens remain valid for 30 days. This patch will be the replacement for basic authentication mechanism. Signed-off-by: Guillaume Vincent <gvincent@redhat.com>
fcharlier
previously approved these changes
Apr 8, 2026
fcharlier
reviewed
Apr 10, 2026
| auth_type = headers.get("Authorization").split(" ")[0] | ||
| if auth_type == "Bearer": | ||
| return am.OpenIDCAuth | ||
| elif auth_type == "JWTBearer": |
Contributor
There was a problem hiding this comment.
Would it be possible to keep using Bearer for our own JWT auth and differentiate based on the issuer ?
E.g.:
elif auth_type == "Bearer":
# Decode without verification to check issuer
token = headers.get("Authorization").split(" ")[1]
unverified = jwt.decode(token, options={"verify_signature": False})
if unverified.get("iss") == "your-dci-server":
return am.JWTAuth
else:
return am.OpenIDCAuth
fcharlier
reviewed
Apr 10, 2026
fcharlier
left a comment
Contributor
There was a problem hiding this comment.
See remark about JWTBearer /vs/ Bearer
Contributor
|
@rh-gvincent I continued this work by removing Basic auth and updating tests & scripts to use JWT auth in this branch: https://github.com/distributedci/dci-control-server/tree/jwt_nobasicauth There's a question leftover about JWT invalidation (or not) on password change. Let's discuss this next week. |
This was referenced Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements JWT-based authentication using Flask-JWT-Extended with login and token refresh functionality.
Access tokens expire after 1 hour while refresh tokens remain valid for 30 days.
This patch will be the replacement for basic authentication mechanism.