You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by skidvd <ap...@abilsoft.com> on 2020/11/13 16:21:57 UTC
TOTP PSQLException following successful LDAP authentication
I have successfully deployed both guacd and guacamole via docker image to AWS
ECS. I have added the TOTP extension to the image. Additionally, I have
successfully configured guacamole to use LDAPs to integrate with a Microsoft
Active Directory and a Postgres database.
Background:
I can see via in the guacamole logs, that a login attempt is successfully
authenticated by the configured LDAPs.
15:25:40.889 [http-nio-8080-exec-4] INFO o.a.g.r.auth.AuthenticationService
- User "<user-name>" successfully authenticated from <ip-address>.
I have additionally verified that the same login attempt (with the same
user/credentials) will result in successful login and access to the
guacamole application when I temporarily deploy WITHOUT the TOTP extension
for testing purposes. As I require the MFA protection provided by TOTP,
this is not an acceptable option in this situation.
The problem:
In response to this successful login, the TOTP plugin proceeds to attempt to
add/update the associated user in the Postgres DB. This fails as is shown
in the following guacamole log entries.
15:25:41.003 [http-nio-8080-exec-4] ERROR o.a.g.rest.RESTExceptionMapper -
Unexpected internal error:
### Error updating database. Cause: org.postgresql.util.PSQLException:
ERROR: operator does not exist: integer = character varying
Hint: No operator matches the given name and argument types. You might need
to add explicit type casts.
Position: 487
### The error may involve
org.apache.guacamole.auth.jdbc.user.UserMapper.update-Inline
### The error occurred while setting parameters
### SQL: UPDATE guacamole_user SET password_hash = ?,
password_salt = ?, password_date = ?, disabled = ?,
expired = ?, access_window_start = ?,
access_window_end = ?, valid_from = ?, valid_until =
?, timezone = ?, full_name = ?,
email_address = ?, organization = ?,
organizational_role = ? WHERE user_id = ?
### *Cause: org.postgresql.util.PSQLException: ERROR: operator does not
exist: integer = character varying*
*The associated stack trace stems from
org.apache.guacamole.auth.totp.TOTPAuthenticationProvider.decorate(TOTPAuthenticationProvider.java:76)*
I do not see any available guacamole configuration options that would allow
me to tailor any of the input parameters to the above statement.
What am I doing wrong and/or missing please? Your assistance and insights
will be greatly appreciated please.
--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org
Re: TOTP PSQLException following successful LDAP authentication
Posted by Nick Couchman <vn...@apache.org>.
On Wed, Nov 18, 2020 at 2:54 PM skidvd <ap...@abilsoft.com> wrote:
> Hi Nick,
>
> Thanks for the suggestion.
>
> Actually, I have been running with POSTGRESQL_AUTO_CREATE_ACCOUNTS env
> variable set to true from the onset. However, as you noted, this is most
> likely effectively ignored.
>
>
Yeah, I looked through the startup script, and I don't see it in there, so
I doubt that has any effect.
> Since your posting, I have been searching to determine how best to work
> around this.
>
> The best option appears to be to use the enable-environment-properties
> guacamole setting. However, I have not been successful in finding any
> useful documentation or examples on how to do this within docker.
> Unfortunately, simply adding a guacamole.properties file containing this
> option set to true was unsuccessful.
>
>
Yes, this is definitely one way to go, however you'll have to somehow map
that through to the guacamole.properties file. One of the easier ways would
be to create your /etc/guacamole directory somewhere on your host
filesystem, and then pass that through to /etc/guacamole inside the
Guacamole Client (and guacd, if you like) container(s).
-Nick
Re: TOTP PSQLException following successful LDAP authentication
Posted by skidvd <ap...@abilsoft.com>.
Hi Nick,
Thanks for the suggestion.
Actually, I have been running with POSTGRESQL_AUTO_CREATE_ACCOUNTS env
variable set to true from the onset. However, as you noted, this is most
likely effectively ignored.
Since your posting, I have been searching to determine how best to work
around this.
The best option appears to be to use the enable-environment-properties
guacamole setting. However, I have not been successful in finding any
useful documentation or examples on how to do this within docker.
Unfortunately, simply adding a guacamole.properties file containing this
option set to true was unsuccessful.
--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org
Re: TOTP PSQLException following successful LDAP authentication
Posted by Nick Couchman <vn...@apache.org>.
On Mon, Nov 16, 2020 at 10:21 AM skidvd <ap...@abilsoft.com> wrote:
> I have resolved this issue. To do so, I had to follow the following (less
> than intuitive steps) that I could not find in the guacamole documentation
> -
> perhaps I missed them somehow?
>
> a) deploy guacamole docker image WITHOUT TOTP
> b) login as guacadmin
> c) create local user within guac for LDAP user
> d) login to guac with LDAP (enabling ability to see AD users)
> e) within guacamole, set setting for LDAP user to include 'change own
> password'
> f) redeploy guacamole docker image with TOTP
> g) remember LDAP users are case sensitive
>
> LDAP users can now successfully login to guacamole and associate with MFA.
>
>
Instead of going through those steps, did you try enabling the user
auto-creation?
http://guacamole.apache.org/doc/gug/jdbc-auth.html#jdbc-auth-auto-create
It doesn't look like this option is available as a Docker env variable, so
you'd have to manually add it to guacamole.properties, but it should
resolve at least some of those steps. Also, starting with version 1.2.0 of
Guacamole, TOTP should not require that the user be able to modify their
own account in order for the information to be stored, so, if you're really
using 1.2.0, item "e" on your list definitely is not necessary.
-Nick
Re: TOTP PSQLException following successful LDAP authentication
Posted by skidvd <ap...@abilsoft.com>.
I have resolved this issue. To do so, I had to follow the following (less
than intuitive steps) that I could not find in the guacamole documentation -
perhaps I missed them somehow?
a) deploy guacamole docker image WITHOUT TOTP
b) login as guacadmin
c) create local user within guac for LDAP user
d) login to guac with LDAP (enabling ability to see AD users)
e) within guacamole, set setting for LDAP user to include 'change own
password'
f) redeploy guacamole docker image with TOTP
g) remember LDAP users are case sensitive
LDAP users can now successfully login to guacamole and associate with MFA.
Steps a) - e) were the key. If you first deploy guacamole with TOTP before
changing the user's 'change own password' setting within guacamole, you will
encounter errors such as I did. FYI, I was NOT able to even see the LDAP
users at first with TOTP deployed and logging in as guacadmin. I needed to
revert to an image that did not have TOTP and then create a local user to
match LDAP user.
--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org