You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by mike-jumper <gi...@git.apache.org> on 2016/08/13 04:14:01 UTC

[GitHub] incubator-guacamole-client pull request #56: GUACAMOLE-78: Handle anonymous ...

GitHub user mike-jumper opened a pull request:

    https://github.com/apache/incubator-guacamole-client/pull/56

    GUACAMOLE-78: Handle anonymous users distinctly.

    There has historically been no way to properly represent an anonymous user within the Guacamole extension API. All users are required to have unique identifiers, and the user interface renders a user-specific menu with logout button at all times.
    
    This change defines a reserved identifier (`AuthenticatedUser.ANONYMOUS_IDENTIFIER` in Java, `AuthenticationResult.ANONYMOUS_USERNAME` in JavaScript, in both cases simply the empty string) which implicitly declares the user as anonymous, but must not be used for any other purpose. The JDBC authentication has been modified to return this username when a user authenticated via a share key (and thus has no associated user account).
    
    Unlike a traditionally-authenticated user, an anonymous user is not presented the "user menu" which  typically contains the "Home", "Settings", and "Logout" options. When rendered within the admin interface, anonymous users are listed as "Anonymous" with contrasting styling:
    
    ![anonymous-username-style](https://cloud.githubusercontent.com/assets/4632905/17641346/4ff54b2e-60d0-11e6-91b3-41227d3f6c7b.png)
    
    Anonymous users' authentication results are also not persisted via a cookie like normal users, thus their session is transient. Closing the tab will effectively log the user out.
    
    Part of this involved actually defining a type within JavaScript for the JSON returned from authentication attempts (now `AuthenticationResult`, in the `auth` module), which up until now has never been documented client-side.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mike-jumper/incubator-guacamole-client anonymous-users

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-guacamole-client/pull/56.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #56
    
----
commit fcefa7a7c7a0454994f0e184b70a2b4d631f12ec
Author: Michael Jumper <mj...@apache.org>
Date:   2016-08-12T19:51:53Z

    GUACAMOLE-78: Define a standard identifier for anonymous users.

commit df3f54a02d1a59e39b3c5cfb366436dddc58ecc4
Author: Michael Jumper <mj...@apache.org>
Date:   2016-08-12T20:51:37Z

    GUACAMOLE-78: Report users authenticated via share keys as anonymous.

commit c6323503d86520d0d261baea5a9cbe516f1c8dc9
Author: Michael Jumper <mj...@apache.org>
Date:   2016-08-12T20:55:59Z

    GUACAMOLE-78: Do not display user menu for anonymous users.

commit 22b3e268d6a5f3480af145b05e51677a396c7686
Author: Michael Jumper <mj...@apache.org>
Date:   2016-08-12T21:18:33Z

    GUACAMOLE-78: Use documented AuthenticationResult type for auth result storage.

commit 225736d2373c9035083b11198c08993f6e494d1c
Author: Michael Jumper <mj...@apache.org>
Date:   2016-08-12T21:49:37Z

    GUACAMOLE-78: Store anonymous users' authentication results in memory only. Do not persist via cookie.

commit 42cd4dca5d0b6a68052744604d32693d6497aa7c
Author: Michael Jumper <mj...@apache.org>
Date:   2016-08-12T21:53:54Z

    GUACAMOLE-78: Preserve query parameters when redirecting to user's home page.

commit 21f184f42e63c5a338354d17fbcd06db7602c310
Author: Michael Jumper <mj...@apache.org>
Date:   2016-08-13T03:05:33Z

    GUACAMOLE-78: Render the usernames of anonymous users differently.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-client pull request #56: GUACAMOLE-78: Handle anonymous ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-guacamole-client/pull/56


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-client pull request #56: GUACAMOLE-78: Handle anonymous ...

Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/56#discussion_r74694423
  
    --- Diff: guacamole/src/main/webapp/app/index/config/indexRouteConfig.js ---
    @@ -88,7 +88,7 @@ angular.module('index').config(['$routeProvider', '$locationProvider',
     
                     // Otherwise, reject and reroute
                     else {
    -                    $location.url(homePage.url);
    +                    $location.path(homePage.url);
    --- End diff --
    
    Is this change in order to preserve potential url parameters?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-client pull request #56: GUACAMOLE-78: Handle anonymous ...

Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/56#discussion_r74694459
  
    --- Diff: guacamole/src/main/webapp/app/index/config/indexRouteConfig.js ---
    @@ -88,7 +88,7 @@ angular.module('index').config(['$routeProvider', '$locationProvider',
     
                     // Otherwise, reject and reroute
                     else {
    -                    $location.url(homePage.url);
    +                    $location.path(homePage.url);
    --- End diff --
    
    Yep. Lacking this change, URL parameters are wiped out when the user is routed to their only connection.
    
    Without the share key continuing to be present in the URL, reloading the tab fails results in a login page rather than the connection they were just using (a pretty severe violation of the [Principle of Least Surprise](https://en.wikipedia.org/wiki/Principle_of_least_astonishment)). Navigating back to the connection after visiting a different page would fail for the same reason.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---