Problem configuration vikunja and authentik username randomly

HI all,

I read the other topic to the same problem but I don’t know why don’t work for me …

Possible help me to clarify the full configuration…

Authentication with Authentik work but in list user, the mail is ok but username not is randomly

thank’s for your help

You meant the username in Vikunja are the ones that you set in Authentik?

Yes I want this @kolaente

example: user in authentik

detail user:

but in vikunja the username is randomly generate :

You’ll need to set up your Authentik so that it returns the username of that user in the preferred_username field, as mentioned in the docs.

I didn’t test it, but this might work: https://www.perplexity.ai/search/how-can-i-configure-authentik-q.hDn4BSTBaZ7MB.hYNdlA

YEs I tested but nothing work

ChatGPT, Perplexity, claud.ai is the same result : don’t work:

this is my config.yaml

auth:
  # Local authentication will let users log in and register (if enabled) through the db.
  # This is the default auth mechanism and does not require any additional configuration.
  local:
    # Enable or disable local authentication
    enabled: true
  # OpenID configuration will allow users to authenticate through a third-party OpenID Connect compatible provider.<br/>
  # The provider needs to support the `openid`, `profile` and `email` scopes.<br/>
  # **Note:** Some openid providers (like gitlab) only make the email of the user available through openid claims if they have set it to be publicly visible.
  # If the email is not public in those cases, authenticating will fail.
  # **Note 2:** The frontend expects to be redirected after authentication by the third party
  # to <frontend-url>/auth/openid/<auth key>. Please make sure to configure the redirect url with your third party
  # auth service accordingly if you're using the default Vikunja frontend.
  # Take a look at the [default config file](https://github.com/go-vikunja/api/blob/main/config.yml.sample) for more information about how to configure openid authentication.
  openid:
    # Enable or disable OpenID Connect authentication
    enabled: true
    # A list of enabled providers
    providers:
      # The name of the provider as it will appear in the frontend.
      - name: "authentik Login"
        # The auth url to send users to if they want to authenticate using OpenID Connect.
        authurl: https://auth.xxxxx.xx/application/o/vikunja/
        logouturl: "https://auth.xxxxx.xx/application/o/vikunja/end-session/"
        # The client ID used to authenticate Vikunja at the OpenID Connect provider.
        clientid: b4OnrHzxilAPDUxxxxxxxxxxZueJmb7yOggWqi0m8b
        # The client secret used to authenticate Vikunja at the OpenID Connect provider.
        clientsecret:  RlSjje1FJqzhOsLCXeQfXfJE0tPVxxxxxxxxxxxx6ETghOetArmRRJgvnNxxxxxxxxxxxxxi3gSXQVj76Ep99FIExxxxxqvCoifi4bf8zwzc
        # scope
        scope: openid profile email vikunja_scope

in authentik provider config:

I don’t know what to do anymore to make this work :sleepy:

See here, I think this is what I used to correct the same issue I had. It has been a while so my memory may be a bit fuzzy, but you should be able to change your username via Authentik

Or this:

thank’s for your reply, i read two topic but same result… in my authentik the username and name is same if you look this pictures…

it’s very difficult to search information how to configure this with authentik and vikinja :frowning:

Can you try to delete and recreate the user? i would backup first, but may be what is needed

The username mapping is only taken into account when you log in the first time.

1 Like

It’s now ok For me the user login with Goauthentik have now the username authentik in Vikunja

this is my configuration for further user have the same problem/question :slight_smile:

go authentik :
Go to customization and click on create:

add this information:

in Authentik provider used for vikunja (OAuth2) it’s necessary to add the scope created before select "Based on the User’s hashed ID and enabled “Include Claims inid_token”:

After user is loged by authentik, in vikunja user list cli :

:slight_smile:

1 Like