You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by Mark Nolan <ma...@gmail.com> on 2018/05/09 13:40:58 UTC

Extension session resource

I'm new to guacamole.

Hopefully I have understood this correctly.

I want to create an extension that exposes a RESTful resource. Eventually,
the resource will connect to the Google Cloud Platform API to allow some
users to start and stop the host that provides a particular connection.

Currently it implements the AuthenticationProvider interface in a minimal
way, influenced by the SimpleAuthenticationProvider. It doesn't
authenticate, but it returns a UserContext. The UserContext returns empty
lists and directories, except for the root (an empty connection group) and
the user. All of this seems to work fine - all the methods log (debug
logging is enabled) and I see the methods being called as I expected. In
particular, I can see getUserContext being called.

However, I can't seem to get the RESTful bit to work.

The UserContext implements getResource. This returns a simple resource that
works fine if I use it in a standalone service. But, even if it didn't, I
never see getResource being called.

And no matter what I use as the URL (within /api/session/ext), I get a
permission denied reply, which implies that an exception has been
intercepted. But no exception is logged either, so I can't see any details.
In fact, nothing is logged at all.

So, before I switch into full-blown debugging mode, can someone point me in
the right direction.

Am I on the right track?

Thanks,
Mark

Re: Extension session resource

Posted by Mark Nolan <ma...@gmail.com>.
No worries. I am an idiot! I forgot to attach the token to the request :$
It actually works perfectly.

M.
.


On 9 May 2018 at 15:00, Nick Couchman <vn...@apache.org> wrote:

> On Wed, May 9, 2018 at 9:40 AM, Mark Nolan <ma...@gmail.com> wrote:
>
> > I'm new to guacamole.
> >
> > Hopefully I have understood this correctly.
> >
> > I want to create an extension that exposes a RESTful resource.
> Eventually,
> > the resource will connect to the Google Cloud Platform API to allow some
> > users to start and stop the host that provides a particular connection.
> >
> > Currently it implements the AuthenticationProvider interface in a minimal
> > way, influenced by the SimpleAuthenticationProvider. It doesn't
> > authenticate, but it returns a UserContext. The UserContext returns empty
> > lists and directories, except for the root (an empty connection group)
> and
> > the user. All of this seems to work fine - all the methods log (debug
> > logging is enabled) and I see the methods being called as I expected. In
> > particular, I can see getUserContext being called.
> >
> > However, I can't seem to get the RESTful bit to work.
> >
> > The UserContext implements getResource. This returns a simple resource
> that
> > works fine if I use it in a standalone service. But, even if it didn't, I
> > never see getResource being called.
> >
> > And no matter what I use as the URL (within /api/session/ext), I get a
> > permission denied reply, which implies that an exception has been
> > intercepted. But no exception is logged either, so I can't see any
> details.
> > In fact, nothing is logged at all.
> >
> > So, before I switch into full-blown debugging mode, can someone point me
> in
> > the right direction.
> >
> > Am I on the right track?
> >
>
> Mark,
> Any chance you can share the code?  It sounds to me like you're on the
> right track, and I'm guessing it has something to do with the link between
> the authentication provider and the user context classes.
>
> -Nick
>

Re: Extension session resource

Posted by Nick Couchman <vn...@apache.org>.
On Wed, May 9, 2018 at 9:40 AM, Mark Nolan <ma...@gmail.com> wrote:

> I'm new to guacamole.
>
> Hopefully I have understood this correctly.
>
> I want to create an extension that exposes a RESTful resource. Eventually,
> the resource will connect to the Google Cloud Platform API to allow some
> users to start and stop the host that provides a particular connection.
>
> Currently it implements the AuthenticationProvider interface in a minimal
> way, influenced by the SimpleAuthenticationProvider. It doesn't
> authenticate, but it returns a UserContext. The UserContext returns empty
> lists and directories, except for the root (an empty connection group) and
> the user. All of this seems to work fine - all the methods log (debug
> logging is enabled) and I see the methods being called as I expected. In
> particular, I can see getUserContext being called.
>
> However, I can't seem to get the RESTful bit to work.
>
> The UserContext implements getResource. This returns a simple resource that
> works fine if I use it in a standalone service. But, even if it didn't, I
> never see getResource being called.
>
> And no matter what I use as the URL (within /api/session/ext), I get a
> permission denied reply, which implies that an exception has been
> intercepted. But no exception is logged either, so I can't see any details.
> In fact, nothing is logged at all.
>
> So, before I switch into full-blown debugging mode, can someone point me in
> the right direction.
>
> Am I on the right track?
>

Mark,
Any chance you can share the code?  It sounds to me like you're on the
right track, and I'm guessing it has something to do with the link between
the authentication provider and the user context classes.

-Nick