You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Oliver Jones <ol...@glance.net> on 2016/08/09 15:54:20 UTC

custom authentication provider

Hi, all.

I'm working on a custom authentication provider, following the example in
Chapter 18 of the manual.

I'm trying to authenticate using a one-time URL looking something like this:

     https://hostname/guacamole?sessionkey=HardToGuessValue

It seems, from the definition of the Credentials object, that I should be
able to use code like this:

       HttpServletRequest request = credentials.getRequest();
       String sessionkey = request.getParameter("sessionkey");

But, getParameter(), in this context, returns a null string.
 getParameterMap() returns an empty dictionary object.   I'm obviously
missing something. What's the right way to get URL parameters into a custom
authentication provider?

Thanks.

Re: custom authentication provider

Posted by Oliver Jones <ol...@glance.net>.
On Tue, Aug 9, 2016 at 12:26 PM, Mike Jumper <mi...@guac-dev.org>
wrote:

> https://hostname/guacamole/#/?sessionkey=HardToGuessValue
>

Sure enough, thank you Mike.

Re: custom authentication provider

Posted by Mike Jumper <mi...@guac-dev.org>.
On Tue, Aug 9, 2016 at 8:54 AM, Oliver Jones <ol...@glance.net> wrote:

> Hi, all.
>
> I'm working on a custom authentication provider, following the example in
> Chapter 18 of the manual.
>
> I'm trying to authenticate using a one-time URL looking something like
> this:
>
>      https://hostname/guacamole?sessionkey=HardToGuessValue
>
> It seems, from the definition of the Credentials object, that I should be
> able to use code like this:
>
>        HttpServletRequest request = credentials.getRequest();
>        String sessionkey = request.getParameter("sessionkey");
>
> But, getParameter(), in this context, returns a null string.
>  getParameterMap() returns an empty dictionary object.   I'm obviously
> missing something. What's the right way to get URL parameters into a custom
> authentication provider?
>
>
That's the right way - but try:

https://hostname/guacamole/#/?sessionkey=HardToGuessValue

I think you're just running into differences in the way that AngularJS
handles query parameters. It's ultimately the client-side JavaScript which
grabs the parameters from the URL and forwards them along with the auth
attempt that occurs whenever a page is visited.

- Mike