obiba / docker-opal

GNU General Public License v3.0
7 stars 11 forks source link

Authentication failure #32

Closed meerkat256 closed 1 year ago

meerkat256 commented 1 year ago

Hello,

Running docker compose on this repo leads to authentication errors on my system. My docker-compose file looks like this:

version: '3' services: opal: image: obiba/opal:snapshot

build: .

            ports:
                    - "8870:8080"
            depends_on:
                    - mongo
                    - mysqldata
                    - mariadbdata
                    - postgresdata
                    - rock1
                    - rock2
            environment:
                    - OPAL_ADMINISTRATOR_PASSWORD=password
                    - MONGO_HOST=mongo
                    - MONGO_PORT=27017
                    - MONGO_USER=root
                    - MONGO_PASSWORD=example
                    - MYSQLDATA_DATABASE=opal
                    - MYSQLDATA_HOST=mysqldata
                    - MYSQLDATA_USER=opal
                    - MYSQLDATA_PASSWORD=password
                    - MARIADBDATA_DATABASE=opal
                    - MARIADBDATA_HOST=mariadbdata
                    - MARIADBDATA_USER=opal
                    - MARIADBDATA_PASSWORD=password
                    - POSTGRESDATA_DATABASE=opal
                    - POSTGRESDATA_HOST=postgresdata
                    - POSTGRESDATA_USER=opal
                    - POSTGRESDATA_PASSWORD=password
                    - ROCK_HOSTS=rock1:8085,rock2:8085
            volumes:
                    - ./target/opal:/srv
    mongo:
            image: mongo
            environment:
                    - MONGO_INITDB_ROOT_USERNAME=root
                    - MONGO_INITDB_ROOT_PASSWORD=example
    mysqldata:
            image: mysql:5
            environment:
                    - MYSQL_DATABASE=opal
                    - MYSQL_ROOT_PASSWORD=password
                    - MYSQL_USER=opal
                    - MYSQL_PASSWORD=password
    mariadbdata:
            image: mariadb
            environment:
                    - MYSQL_DATABASE=opal
                    - MYSQL_ROOT_PASSWORD=password
                    - MYSQL_USER=opal
                    - MYSQL_PASSWORD=password
    postgresdata:
            image: postgres
            environment:
                    - POSTGRES_DB=opal
                    - POSTGRES_USER=opal
                    - POSTGRES_PASSWORD=password
    rock1:
            image: datashield/rock-base:latest
            environment:
                    - ROCK_ID=default-1
                    - ROCK_CLUSTER=default
    rock2:
            image: datashield/rock-base:latest
            environment:
                    - ROCK_ID=default-2
                    - ROCK_CLUSTER=default

Now when I connect to localhost:8870 I get an authentication error. The Logger gives the two messages that might be related:

WARN org.jboss.resteasy.resteasy_jaxrs.i18n - RESTEASY002142: Multiple resource methods match request "GET /auth/session/_current/username". Selecting one. Matching methods: [public org.obiba.opal.web.model.Opal$Subject org.obiba.opal.web.security.AuthenticationResource.getSubject(java.lang.String), public org.obiba.opal.web.model.Opal$Subject org.obiba.opal.web.security.AuthenticationResource.getCurrentSubject()] (before I log in) WARN org.obiba.shiro.web.filter.AbstractAuthenticationExecutor - Login failed for user 'opal' [1] INFO org.obiba.opal.web.security.AuthenticationResource - Authentication failure of user 'opal' at ip: '10.89.1.5': No account information found for authentication token [org.apache.shiro.authc.UsernamePasswordToken - opal, rememberMe=false] by this Authenticator instance. Please check that it is configured correctly.

In issue #17 the fix had been to use https://localhost, which changes the error. Now, the browser returns one:

Firefox: SSL_ERROR_RX_RECORD_TOO_LONG Edge: ERR_SSL_PROTOCOL_ERROR ("localhost has send an invalid response")

I use no proxies and checked a couple of versions back Currently, I am at commit 4ae4aa04e2e0de490f220cc65cdffc7b27d8a5b8..

Thank you for your support.

kazoompa commented 1 year ago

Hi,

FYI: I just used your docker-compose and did not have any problem connecting to http://localhost:8870/.

I ran docker compose up -d on a Ubuntu 22.04, with Docker version 24.0.7, build afdd53b.

Best,

On Thu, Nov 16, 2023 at 6:32 AM mercrat233 @.***> wrote:

Hello,

Running docker compose on this repo leads to authentication errors on my system. My docker-compose file looks like this:

version: '3' services: opal: image: obiba/opal:snapshot

build: .

ports:

  • "8870:8080" depends_on:
  • mongo
  • mysqldata
  • mariadbdata
  • postgresdata
  • rock1
  • rock2 environment:
  • OPAL_ADMINISTRATOR_PASSWORD=password
  • MONGO_HOST=mongo
  • MONGO_PORT=27017
  • MONGO_USER=root
  • MONGO_PASSWORD=example
  • MYSQLDATA_DATABASE=opal
  • MYSQLDATA_HOST=mysqldata
  • MYSQLDATA_USER=opal
  • MYSQLDATA_PASSWORD=password
  • MARIADBDATA_DATABASE=opal
  • MARIADBDATA_HOST=mariadbdata
  • MARIADBDATA_USER=opal
  • MARIADBDATA_PASSWORD=password
  • POSTGRESDATA_DATABASE=opal
  • POSTGRESDATA_HOST=postgresdata
  • POSTGRESDATA_USER=opal
  • POSTGRESDATA_PASSWORD=password
  • ROCK_HOSTS=rock1:8085,rock2:8085 volumes:
  • ./target/opal:/srv mongo: image: mongo environment:
  • MONGO_INITDB_ROOT_USERNAME=root
  • MONGO_INITDB_ROOT_PASSWORD=example mysqldata: image: mysql:5 environment:
  • MYSQL_DATABASE=opal
  • MYSQL_ROOT_PASSWORD=password
  • MYSQL_USER=opal
  • MYSQL_PASSWORD=password mariadbdata: image: mariadb environment:
  • MYSQL_DATABASE=opal
  • MYSQL_ROOT_PASSWORD=password
  • MYSQL_USER=opal
  • MYSQL_PASSWORD=password postgresdata: image: postgres environment:
  • POSTGRES_DB=opal
  • POSTGRES_USER=opal
  • POSTGRES_PASSWORD=password rock1: image: datashield/rock-base:latest environment:
  • ROCK_ID=default-1
  • ROCK_CLUSTER=default rock2: image: datashield/rock-base:latest environment:
  • ROCK_ID=default-2
  • ROCK_CLUSTER=default

Now when I connect to localhost:8870 I get an authentication error. The Logger gives the two messages that might be related:

WARN org.jboss.resteasy.resteasy_jaxrs.i18n - RESTEASY002142: Multiple resource methods match request "GET /auth/session/_current/username". Selecting one. Matching methods: [public org.obiba.opal.web.model.Opal$Subject org.obiba.opal.web.security.AuthenticationResource.getSubject(java.lang.String), public org.obiba.opal.web.model.Opal$Subject org.obiba.opal.web.security.AuthenticationResource.getCurrentSubject()] (before I log in) WARN org.obiba.shiro.web.filter.AbstractAuthenticationExecutor - Login failed for user 'opal' [1] INFO org.obiba.opal.web.security.AuthenticationResource - Authentication failure of user 'opal' at ip: '10.89.1.5': No account information found for authentication token [org.apache.shiro.authc.UsernamePasswordToken - opal, rememberMe=false] by this Authenticator instance. Please check that it is configured correctly.

In issue #17 https://github.com/obiba/docker-opal/issues/17 the fix had been to use https://localhost, which changes the error. Now, the browser returns one:

Firefox: SSL_ERROR_RX_RECORD_TOO_LONG Edge: ERR_SSL_PROTOCOL_ERROR ("localhost has send an invalid response")

I use no proxies and checked a couple of versions back Currently, I am at commit 4ae4aa0 https://github.com/obiba/docker-opal/commit/4ae4aa04e2e0de490f220cc65cdffc7b27d8a5b8 ..

Thank you for your support.

— Reply to this email directly, view it on GitHub https://github.com/obiba/docker-opal/issues/32, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVPF7HTEHR6Y6VI6DC5ETLYEX2TBAVCNFSM6AAAAAA7N74II2VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TMNRVGQ4DIOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

meerkat256 commented 1 year ago

And you used the credentials opal:password, right?

kazoompa commented 1 year ago

Yes, administrator, password.

I also used links instead of depends_on, see the difference here.

meerkat256 commented 1 year ago

Thank you for you help! The username was simply wrong.