-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GUACAMOLE-1949 Nextcloud JWT Auth extension #984
base: main
Are you sure you want to change the base?
Conversation
...e-auth-nextcloud/src/main/java/org/apache/guacamole/auth/nextcloud/ConfigurationService.java
Show resolved
Hide resolved
...e-auth-nextcloud/src/main/java/org/apache/guacamole/auth/nextcloud/ConfigurationService.java
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...e-auth-nextcloud/src/main/java/org/apache/guacamole/auth/nextcloud/user/UserDataService.java
Outdated
Show resolved
Hide resolved
...e-auth-nextcloud/src/main/java/org/apache/guacamole/auth/nextcloud/user/UserDataService.java
Outdated
Show resolved
Hide resolved
...extcloud/src/main/java/org/apache/guacamole/auth/nextcloud/connection/ConnectionService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more changes from me - at this point mostly style and documentation.
Also, your pull request and commit messages are formatted slightly incorrectly - should be:
GUACAMOLE-1949: Nextcloud JWT authentication extension
with a ":" between the Jira issue and the comment.
extensions/guacamole-auth-nextcloud/src/main/resources/guac-manifest.json
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...th-nextcloud/src/main/java/org/apache/guacamole/auth/nextcloud/RequestValidationService.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...e-auth-nextcloud/src/main/java/org/apache/guacamole/auth/nextcloud/ConfigurationService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more things to tweak - it's getting very close :-).
In general, make sure you're following established style guidelines within the code. In particular:
- Don't cuddle braces for both
if...else
andtry...catch
statements. - Make sure your JavaDoc comments are properly spaced.
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
private boolean validIpAddress(final String ipAddress) throws GuacamoleException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put empty lines between @param
, @return
, and @throws
.
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
Thank you for your patience. I've cleaned up a bit and hope it doesn't look any worse as a result 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more changes - getting close. As mentioned in one of the comments below, I am wondering why this doesn't go ahead and authenticate the user to Guacamole? Is there some reason you wouldn't want users to be automatically logged in?
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ud/src/main/java/org/apache/guacamole/auth/nextcloud/NextcloudJwtAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
I've added a README.md to explain the configuration. |
Hi all,
I have built a small extension for myself and would like to share it with you. Maybe this is a function that would go well with Guacamole.
I use a self-hosted Nextcloud and the plugin “External Sites”. This plugin offers the possibility to send a JWT to an embedded website. This JWT is (Nextcloud) user-related and always valid for 1 minute. If the JWT is missing or has expired, an excpetion will be thrown. The extension validates the JWT and if it is valid, the Guacamole login screen is displayed. Everything else then proceeds as usual. Additionally, I have implemented that only certain Nextcloud users are allowed this access, independent of a valid JWT.
I have decided to not make the login screen accessible worldwide, that's why an exception will be thrown if anyone call the guacamole client directly (
https://example.com/guacamole
) and a login is only possible within the Nextcloud (https://cloud.example.com/
).Another small additional use case in my environment: The login screen should still be displayed for a few clients (via IP addresses), so the IP address will be checked and validated.
Jira Ticket GUACAMOLE-1949