Merged
Conversation
8739438 to
eb6a79c
Compare
bb33622 to
529dca3
Compare
aaronweeden
requested changes
Jun 30, 2025
aaronweeden
requested changes
Jun 30, 2025
jpwhite4
reviewed
Jun 30, 2025
jpwhite4
reviewed
Jun 30, 2025
jpwhite4
reviewed
Jun 30, 2025
* Removing window.focus() * Wrapping decode() in proper html error status exception
Contributor
|
Just a heads up, when I check out the repo and attempt to just a quick |
ryanrath
previously requested changes
Jun 30, 2025
Contributor
There was a problem hiding this comment.
After fixing the missing private static property in JsonWebToken I've run into the following:
2025-06-30 21:14:31 [error] Exception Code: 0
2025-06-30 21:14:31 [error] Message: OpenSSL unable to sign data
2025-06-30 21:14:31 [error] Origin: /usr/share/xdmod/vendor/firebase/php-jwt/src/JWT.php (line 256)
2025-06-30 21:14:31 [error] Trace:
#0 /usr/share/xdmod/vendor/firebase/php-jwt/src/JWT.php(219): Firebase\JWT\JWT::sign()
#1 /usr/share/xdmod/classes/Models/Services/JsonWebToken.php(34): Firebase\JWT\JWT::encode()
#2 /usr/share/xdmod/classes/Rest/Controllers/AuthenticationControllerProvider.php(139): Models\Services\JsonWebToken::encode()
#3 /usr/share/xdmod/vendor/symfony/http-kernel/HttpKernel.php(169): Rest\Controllers\AuthenticationControllerProvider->redirectWithJwt()
#4 /usr/share/xdmod/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#5 /usr/share/xdmod/vendor/silex/silex/src/Silex/Application.php(496): Symfony\Component\HttpKernel\HttpKernel->handle()
#6 /usr/share/xdmod/vendor/silex/silex/src/Silex/Application.php(477): Silex\Application->handle()
#7 /usr/share/xdmod/html/rest/index.php(25): Silex\Application->run()
#8 {main}
I'm guessing there's some setup steps that need to be done maybe?
Edit: I just needed to run the following:
ssh-keygen -t rsa -b 4096 -m PEM -f /etc/xdmod/keys/xdmod-private.pemmaybe it could be added to bootstrap.sh?
aaronweeden
reviewed
Jun 30, 2025
jpwhite4
previously requested changes
Jul 1, 2025
aaronweeden
reviewed
Jul 1, 2025
aaronweeden
requested changes
Jul 7, 2025
aaronweeden
reviewed
Jul 7, 2025
aaronweeden
reviewed
Jul 7, 2025
aaronweeden
reviewed
Jul 8, 2025
aaronweeden
approved these changes
Jul 8, 2025
Review comments addressed
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.
This PR adds authentication to and from XDMoD via JSON Web Tokens (JWTs). This is necessary for an instance of XDMoD to communicate with an instance of JupyterHub. This PR also contains UI elements to redirect to an instance of JupyterHub.
Description
These changes include the following additions:
JsonWebTokenclass withencode()anddecode()static functions to encode and decode JWTsauthenticateJSONWebToken()for theTokensclass that accepts a JWT and returns an XDMoD user if it is a valid JWTAuthenticationControllerProviderclass calledjwt-redirectthat sets a cookie namedxdmod_jwtwith a valid JWT and redirects to a URL specified in the endpoint's parameterThe
authenticateTokenmethod in theTokensclass is also updated to handle both API tokens and JSON Web Tokens.Motivation and Context
The changes in this PR are necessary to allow communication between instances of XDMoD and JupyterHub.
Tests performed
Checklist: