tchiotludo / akhq

Kafka GUI for Apache Kafka to manage topics, topics data, consumers group, schema registry, connect and more...
https://akhq.io/
Apache License 2.0
3.34k stars 646 forks source link

0.25.0 Browser Safari login doesn't work - seems to be a redirect issue #1790

Open markush81 opened 3 months ago

markush81 commented 3 months ago

Minimal application.yml:

micronaut:
  security:
    enabled: true
    token:
      jwt:
        signatures:
          secret:
            generator:
              secret: d74ff0ee8da3b9806b18c877dbf29bbde50b5bd8e4dad7a3a725000feb82e8f1

akhq:
  server:
    access-log:
      enabled: true

  connections:
    dummy:
      properties:
        bootstrap.servers: localhost:9092
      schema-registry:
        url: https://localhost:8082

  security:
    roles:
      node-admin:
        - resources: [ "NODE" ]
          actions: [ "READ", "READ_CONFIG", "ALTER_CONFIG" ]

    default-group: admin
    groups:
      admin:
        - role: node-admin

    basic-auth:
      - username: user
        password: d74ff0ee8da3b9806b18c877dbf29bbde50b5bd8e4dad7a3a725000feb82e8f1
        groups:
          - admin

Password: pass

Running

docker run -v `pwd`/application.yml:/app/application.yml -p 8080:8080 tchiotludo/akhq:0.25.0

Chrome works just fine.

Screenshot 2024-05-27 at 11 27 41

In Safari there is a

Unhandled Promise Rejection: SyntaxError: The string did not match the expected pattern.

without any reference, where it happens.

Screenshot 2024-05-27 at 11 28 13

The only call made is to /login

 INFO  default-nioEventLoopGroup-1-11 org.akhq.log.access [Date: 2024-05-27T09:33:19.686800276Z] [Duration: 6 ms] [Url: POST /login] [Status: 303] [Ip: /192.168.215.1] [User: Anonymous]

(looks same when Chrome does the login on server side)

What is surprising, reload http://localhost:8080/ui in browser again (without the /login suffix ...) we're logged in. So it really just seems to be sth. in browser goes wrong, when trying to redirect to first pager after login.

AlexisSouquiere commented 3 months ago

I can reproduce the issue on my side. However it works fine if I change the authentication to bearer. I label as a bug and will investigate further

micronaut:
  security:
    enabled: true
    authentication: bearer
markush81 commented 3 months ago

Thanks ... i can confirm the authentication: bearer helps. So a workaround.

haraldott commented 2 months ago

Weird... adding authentication: bearer there will just result in a blank landing page of akhq with just the logo, but without the username and password field. No errors in the logs.

image

AhmedY0unes commented 2 months ago

Weird... adding authentication: bearer there will just result in a blank landing page of akhq with just the logo, but without the username and password field. No errors in the logs.

I had the same issue, it seems to be because there was an ldap options and i have removed them, when i reverted that, the login fields returned. Another reason was that i added the basic auth section to the security in micronaut and not the one in akhq.