dashy icon indicating copy to clipboard operation
dashy copied to clipboard

[BUG] auth doesnt work, especially keycloak

Open Ev0genii opened this issue 2 years ago • 46 comments

Environment

Self-Hosted (Docker)

System

debian

Version

2.1.1

Describe the problem

Deploy dashy in kubernetes with ingress tried to make auth by dashy documentation, but it didnt work, even basic auth with user hash and title also auth parameters as enableGuestAccess doesnt work i think its something in last update, that interfere auth work last git update was a week ago, maybe u didnt update documentation

Additional info

No response

Please tick the boxes

Ev0genii avatar Aug 18 '23 09:08 Ev0genii

If you're enjoying Dashy, consider dropping us a ⭐
🤖 I'm a bot, and this message was automated

liss-bot avatar Aug 18 '23 09:08 liss-bot

Same here. Basic auth is not working.

juancarlosm avatar Aug 28 '23 06:08 juancarlosm

Was about to give up, because I couldn't find what I was doing wrong. Tried a couple of different options, but below is latest. After applying below to the config, I also get the message that I'm not logged in as admin. When trying to force via URL to login I just get redirected to Dashy homepage.

https://url/login redirects to https://url/

I deleted cache, restarts, incognito, other browsers etc.

appConfig:
  theme: nord-frost
  layout: auto
  iconSize: medium
  language: en
  auth:
    users:
    - user: randyjc
      hash: <REDACTED>
      type: admin
pageInfo:
  title: Dashy
  description: Welcome to your new dashboard!
  navLinks:
    - title: GitHub
      path: https://github.com/Lissy93/dashy
    - title: Documentation
      path: https://dashy.to/docs
sections:
  - name: Getting Started
    icon: fas fa-rocket
    items:
      - title: Dashy Live
        description: Development a project management links for Dashy
        icon: https://i.ibb.co/qWWpD0v/astro-dab-128.png
        url: https://live.dashy.to/
        target: newtab
        id: 0_1481_dashylive
      - title: GitHub
        description: Source Code, Issues and Pull Requests
        url: https://github.com/lissy93/dashy
        icon: favicon
        id: 1_1481_github

V2.1.1 via PikaPods

EDIT: Probably related: https://github.com/Lissy93/dashy/issues/1126

randyjc avatar Aug 28 '23 20:08 randyjc

same here, auth (basic) doesnt work =(

artemdanielov avatar Aug 29 '23 15:08 artemdanielov

I am new to Dashy (Just set it up about a week ago.) Today I was following the basic auth docs and I am also seeing the same issue. Opening Dashy, I just get to my dashboard. If I go to config, update config, edit config, I see a message across the bottom "You cannot write changes to disk because you are not logged in as an administrator". So it would seem it knows about my new user account that is an admin, however it is not redirecting to login. I've tried multiple browsers (Edge, chromium, Chrome), and multiple PCs, but there is no change. If it matters, I added the auth config by hand from ssh use VI.

Thanks

Andy

ajbrigg49 avatar Aug 31 '23 05:08 ajbrigg49

I seem to be having a similar issue.

clockwinder avatar Aug 31 '23 18:08 clockwinder

+1 Basic auth is NOT working, new user running Docker, auth is configured, dashboard is completely exposed and unsecured.

Have attempted these additional configuration options mentioned in other Issues.

    enableGuestAccess: false
    disableConfigurationForNonAdmin: true

Here is my entire appConfig:

appConfig:
  theme: nord-frost
  layout: auto
  iconSize: medium
  language: en
  auth:
    enableGuestAccess: false
    disableConfigurationForNonAdmin: true
    users:
    - user: *****
      hash: *****
      type: admin

Auth tickets should be a priority.

Related to these other Issues that are getting closed from the timeout bot. It does not appear the repo owner @Lissy93 is responding these.

  • https://github.com/Lissy93/dashy/issues/1082
  • https://github.com/Lissy93/dashy/issues/1063
  • https://github.com/Lissy93/dashy/issues/990
  • https://github.com/Lissy93/dashy/issues/1019

chrgraham avatar Sep 03 '23 21:09 chrgraham

Is this still going on? I think I have the same problem but cant seem to find a fix if there is maybe someone can direct me into the right direction?

Pytonballoon810 avatar Sep 25 '23 21:09 Pytonballoon810

I've not found a solution yet. So for now I've just disabled Dashy.

clockwinder avatar Sep 25 '23 21:09 clockwinder

I am experiencing the same issue too... Neither keycloak nor basic auth working...

Lets hope @Lissy93 can fix it soon somehow.

IbaiBuR avatar Oct 16 '23 21:10 IbaiBuR

+1 No login page showing after enabling auth. With the aforementioned work-around of "enableguestaccess" I've the login button but even if I authenticate with an Admin user, I'm no able to make any conf changes.

EDIT: Reverting to 2.1.0 seems to fix the issue

bloodysneaker avatar Oct 30 '23 11:10 bloodysneaker

+1 on docker swarm 2.1.0 docker image works fine tho. Keeping previous version until fix is available :)

Btw. Thanks for superb app, and no pressure ;)

Maretzky85 avatar Nov 14 '23 21:11 Maretzky85

+1, I have exactly the same problem that is described here and in the other issues (logout button without even logging-in and keycloak weird errors). Reverting to 2.1.0

nOw-Ay avatar Nov 15 '23 11:11 nOw-Ay

+1 , This is not working on Dashy 2.1.1 too. Does not work even after adding enableGuestAccess: true and disableConfigurationForNonAdmin: true parameters. I have tried it in the incognito mode browser too, to ensure its not a caching issue. Any advice is appreciated.

appConfig:
    auth:
        enableGuestAccess: true
        users:
          - user: user1
            hash: ############
            type: admin
          - user: user2
            hash: ##############
            type: normal
      disableConfigurationForNonAdmin: true

coderunway avatar Nov 23 '23 12:11 coderunway

Keycloak works perfectly fine for me.

The needing element is an attribute mapper providing roles and groups to simple attributes "roles" and "groups" in the access token.

image

Does not work in conjunction with basic auth though

jakob1379 avatar Dec 15 '23 12:12 jakob1379

Any progress on this? For me, it also does not work with 2.1.1. With 2.1.0 everything works perfectly though...

djessich avatar Jan 05 '24 18:01 djessich

Any progress on this? For me, it also does not work with 2.1.1. With 2.1.0 everything works perfectly though...

Have you made sure you get the groups with your requests? It works when you add them to the access token

jakob1379 avatar Jan 05 '24 20:01 jakob1379

Edit: It looks like the effects of this (and https://github.com/Lissy93/dashy/issues/1051#issue-1525872151) are far-reaching, I believe a lot of the open bug reports right now could be fixed by this. I've linked a few to my explanation, but I have to leave it there for today - I'll pick this back up if mentioned and/or a maintainer responds.

I believe there are several reasons why this could be happening - in my case it was a combination of two issues.

  • Problem 1: User Error
    • Contrary to what the documentation says, I decided to bind mount ./config:/app/public. This was a mistake, since /app/public is pre-populated with a sample configuration and some other files - including the website icon etc. Only bind mount individual files into /app/public!!
    • _Note: In the release notes for 2.1.1, there was mention about a configuration overhaul - I would wait on this to be released before making any requests/suggestions.
  • Problem 2: First build
    • I haven't had a chance to look fully into this yet, but I believe it's due to how the dashy docker image is built. It runs a node.js server (which is required to support functions like config editing and more), and a "static" site generated from the config. The static site is built at runtime with yarn, and can be manually started with yarn build (or through the UI via Update Configuration > Rebuild Application). The generated site is placed at /app/dist/, which is non-persistent - if you recreate the container (which happens when running docker compose down, or docker compose up -d with an already running container), the contents of /app/dist will be lost. I believe that upon first startup, the site is run directly from source while the first build is created - which leads to inconsistencies in login mentioned in this issue. If (like me) there are issues with auto rebuild, the static site won't be generated automatically - you need to trigger it manually via any of the above methods. Once built, login functions as expected.
    • @Lissy93 do you mind giving this a quick read and response? A yes/no would suffice, I know you are busy with v2.1.2/v3 among other things.

As for solutions to the problem, make sure the static component is built upon container recreation. Since the release notes mentioned a big overhaul, I won't do anything right now, but I have an idea as for how to fix the issue at it's root, should it still exist - make /app/dist persist to an extent (or require yarn build to complete before the container becomes accessible). If a maintainer can give me the go ahead (i.e. this won't be solved by anything that's currently in the works), I'll draft up a PR with the fix (basically add documentation for an additional bind mount, ./cache:/app/dist or the like, and make a few changes to make it work (there's an RM command somewhere that needs a change)).

TheRealGramdalf avatar Jan 10 '24 06:01 TheRealGramdalf

These mentions are just for letting people involved in the other bugs know, sorry for the spam

TheRealGramdalf avatar Jan 10 '24 06:01 TheRealGramdalf

Thanks for looking int this @TheRealGramdalf. I tried at my end again, unfortunately I couldn't get things to work.

  • Added the Keycloack mapper as per the screenshot of @jakob1379, no change unfortunately
  • Ran sudo docker exec -it dashboard yarn as per your note above and still won't get a prompt to logon

Back to v2.1.0 and things are working again…

zell-mbc avatar Jan 10 '24 09:01 zell-mbc

* Ran` sudo docker exec -it dashboard yarn` as per your note above and still won't get a prompt to logon

Did you do sudo docker exec -it dashboard yarn or sudo docker exec -it dashboard yarn build? The latter is what you need for it to build, on my server it takes about ~100s. Make sure to clear all cache (especially if you have the service worker enabled) for it to take effect - there may be residual login cookies etc that mess with things.

TheRealGramdalf avatar Jan 10 '24 18:01 TheRealGramdalf

I just tried your fix and it worked like a charm. Thanks!

okietech avatar Jan 10 '24 18:01 okietech

Did you do sudo docker exec -it dashboard yarn or sudo docker exec -it dashboard yarn build?

The first one :-) Just tried again with yarn build…and bingo! Got my logon dialog! I think that's a workable solution for me until this get fixed for good.

Thanks a lot for helping along, really appreciated!

zell-mbc avatar Jan 10 '24 18:01 zell-mbc

Even with version 2.1.0, I don't achieve keycloak auth to work :( It gives a never ending refresh on the dashy loading screen. Did someone have a working configuration with keycloak to provide ?

pikmin-rgb avatar Jan 14 '24 23:01 pikmin-rgb

Hello,

I'm encountering a couple of issues with Dashy after deploying it using Docker Compose. Here's a summary of my steps and the problems I'm facing:

Initial Deployment: I deployed Dashy using the command docker compose up -d. After deployment, the login screen did not appear as expected.

Rebuilding Dashy: To troubleshoot, I rebuilt Dashy using two methods:

Through the Dashy UI by selecting "Rebuild Application." Via command line with sudo docker exec -it yarn build. After rebuilding, the login screen became available, resolving the initial issue.

Configuration Update Problem: However, a new problem arose where updates made to the Dashy configuration through the UI are not being saved. Interestingly, the changes appear in the configuration file when viewed with cat or vim, but these updates don't reflect within the application itself when I reload the browser, tried also in incognito mode clear cookis. Specifically, I'm looking for help with the following:

Why are the configuration changes not persisting in the UI, even though they're visible in the configuration file? Is there a step I'm missing or a known issue that prevents configuration updates from being saved properly when using Docker? Any insights, suggestions, or guidance on how to resolve this issue would be greatly appreciated. Thank you!

DimitrijaGj avatar Feb 15 '24 11:02 DimitrijaGj

Configuration changes require a rebuild before they take effect. Just trigger that after making changes to the config and you should be good.

TheRealGramdalf avatar Feb 15 '24 18:02 TheRealGramdalf

Configuration changes require a rebuild before they take effect. Just trigger that after making changes to the config and you should be good.

Thanks for the fast response. However, the problem I face after rebuild is that I can not change the configuration in UI, so to say interactively. I do the changes, like add section, as can be seen on the screenshots. I added the "test section" clicked on save disk, after refreshing the page "test section" is gone, but is, in fact, in the config.yml file. It is very inconvenient to rebuild the app after every change. So long story short, I have only problem that after I run it with docker compose up -d, anyone can see the dashboard after just deleting the /login in the URL IP:Port/login is there a workaround I can do to avoid that?? Seems like enableGuestAccess: false do not take effect until the rebuild.

appConfig:
  disableConfigurationForNonAdmin: true
  enableGuestAccess: false
  auth:
    #enableGuestAccess: false
    users:
      - user: user1 

Screenshot 2024-02-16 at 08 00 27 Screenshot 2024-02-16 at 08 00 37

DimitrijaGj avatar Feb 16 '24 08:02 DimitrijaGj

Essentially the issue is that you must rebuild after making any changes, period. This used to happen automatically, but it was recently broken (as of 2.11 iirc?). I haven't looked into the specifics exactly, but that's the TL;DR

TheRealGramdalf avatar Feb 16 '24 22:02 TheRealGramdalf

Essentially the issue is that you must rebuild after making any changes, period. This used to happen automatically, but it was recently broken (as of 2.11 iirc?). I haven't looked into the specifics exactly, but that's the TL;DR

Thx for the answer. I revert it to 2.1.0 and it is working fine. I will wait till the bug is fix in the next releases.

DimitrijaGj avatar Feb 17 '24 19:02 DimitrijaGj

> Even with version 2.1.0, I can't get keycloak authentication to work :( It provides a never-ending refresh on the dash loading screen. Does anyone have a working configuration for keycloak?

I also can't use keycloak for authentication.

jerry-f avatar Mar 01 '24 14:03 jerry-f