Skip to content

Commit

Permalink
guacamole 0.9.14 support
Browse files Browse the repository at this point in the history
  • Loading branch information
aiden0z committed Mar 16, 2018
1 parent c88e9a6 commit 7368670
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
42 changes: 24 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# guacamole-auth-jwt


## Description

This project is a plugin for [Guacamole](http://guac-dev.org), an HTML5 based
Expand All @@ -9,30 +8,29 @@ remote desktop solution supporting VNC/RFB, RDP, and SSH.
This plugin is an [authentication provider](http://guacamole.incubator.apache.org/doc/gug/custom-auth.html) that enables stateless, on-the-fly
configuration of remote desktop connections that are authorized using [JSON WEB TOKEN](https://jwt.io/).


## Deployment & Configuration

* [deploy guacamole extension](http://guacamole.incubator.apache.org/doc/gug/configuring-guacamole.html)
* [custom authentication](http://guacamole.incubator.apache.org/doc/gug/custom-auth.html)

`guacamole-auth-jwt` adds a config keys to `guacamole.properties`:

* `secret-key` - The key that will be used to verify the jwt signature.
* `secret-key` - The key that will be used to verify the jwt signature.

## Usage

#### First
### First

Use flowing parameters as the payload of the jwt to get auth token from the rest api `/api/tokens` of guacamole web server.

* `GUAC_ID` - A connection ID that must be unique per user session, (_required_);
* `exp` - jwt expired time, (_required_);
* `guac.protocol` - One of `vnc`, `rdp`, or `ssh`, (_required_);
* `guac.hostname` - The hostname of the remote desktop server to connect to, (_required_);
* `guac.port` - The port number to connect to, (_required_);
* `guac.username` - (_optional_);
* `guac.password` - (_optional_);
* `guac.*` - (_optional_) Any other configuration parameters recognized by
* `GUAC_ID` - A connection ID that must be unique per user session, (_required_);
* `exp` - jwt expired time, (_required_);
* `guac.protocol` - One of `vnc`, `rdp`, or `ssh`, (_required_);
* `guac.hostname` - The hostname of the remote desktop server to connect to, (_required_);
* `guac.port` - The port number to connect to, (_required_);
* `guac.username` - (_optional_);
* `guac.password` - (_optional_);
* `guac.*` - (_optional_) Any other configuration parameters recognized by
Guacamole can be by prefixing them with `guac.`;

For example, you can use following python code to get token from rest api `/api/tokens` of guacamole web server.
Expand All @@ -59,7 +57,7 @@ resp = requests.post('https://guacamole-server-domain/api/tokens', data={'token'

The json response from `/api/tokens` like:

```
```json
{
"authToken": "167b2301e6d274be94b94e885cdab5c98b59b6e5a88872620e69391947f39efa",
"username": "e4695c00-557c-42bb-b209-8ed522a35d8e",
Expand All @@ -68,21 +66,29 @@ The json response from `/api/tokens` like:
}
```

#### Second
### Second

Use flowing parameters to initialize the websocket connection to guacamole tunnel endpoint `/websocket-tunnel`.

* `GUAC_ID` - A connection ID specified in first step;
* `GUAC_TYPE` - Connection type specified in first step;
* `GUAC_DATA_SOURCE` - The authentication provider identifier, always is 'jwt';
* `token` - Auth token in `/api/tokens` guacamole rest api response json;
* `GUAC_ID` - A connection ID specified in first step;
* `GUAC_TYPE` - Connection type specified in first step;
* `GUAC_DATA_SOURCE` - The authentication provider identifier, always is 'jwt';
* `token` - Auth token in `/api/tokens` guacamole rest api response json;

Request tunnel example:

```
wss://guacamole-server-domain/websocket-tunnel?token=167b2301e6d274be94b94e885cdab5c98b59b6e5a88872620e69391947f39efa&GUAC_DATA_SOURCE=jwt&GUAC_ID=connection_id&GUAC_TYPE=c
```

## Release

Version number will be same with guacmaole start from 0.9.14.

* [Version 0.9.14](https://github.com/aiden0z/guacamole-auth-jwt/releases/download/0.9.14/guacamole-auth-jwt-0.9.14.jar) for guacamole 0.9.14;
* [Version 1.0.1](https://github.com/aiden0z/guacamole-auth-jwt/releases/download/1.0.1/guacamole-auth-jwt-1.0.1.jar) for guacamole 0.9.13-incubating;
* [Version 1.0.0](https://github.com/aiden0z/guacamole-auth-jwt/releases/download/1.0.0/guacamole-auth-jwt-1.0.0.jar) for guacamole 0.9.9;

## License

MIT License
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java'
apply plugin: 'idea'

group = 'com.aiden0z.guacamole-auth-jwt'
version = '1.0.1'
version = '0.9.14'

description = """ guacamole custome authentication based on JSON WEB TOKEN """

Expand All @@ -14,7 +14,7 @@ repositories {
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'org.apache.guacamole', name: 'guacamole-ext', version: '0.9.13-incubating'
compile group: 'org.apache.guacamole', name: 'guacamole-ext', version: '0.9.14'
compile group: 'javax.servlet', name: 'servlet-api', version:'2.5'
compile group: 'com.sun.xml.security', name: 'xml-security-impl', version:'1.0'
compile group: 'com.google.inject', name: 'guice', version: '4.1.0'
Expand All @@ -23,5 +23,4 @@ dependencies {

testCompile group: 'junit', name: 'junit', version:'4.11'
testCompile 'org.mockito:mockito-core:2.+'

}
2 changes: 1 addition & 1 deletion src/main/resources/guac-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{

"guacamoleVersion" : "0.9.13-incubating",
"guacamoleVersion" : "0.9.14",
"name" : "Jwt Authentication",
"namespace" : "guac-jwt",
"authProviders" : ["com.aiden0z.guacamole.net.jwt.JwtAuthenticationProvider"]
Expand Down

0 comments on commit 7368670

Please sign in to comment.