Environment-variable for openid-provider #978

Open
opened 2021-09-14 18:58:01 +00:00 by mawoka · 6 comments

Hello and sorry for my probably stupid question: How do I set up a custom auth-provider via environment-variables?

This is my setup:

environment:
      VIKUNJA_AUTH_LOCAL_ENABLED: 1
      VIKUNJA_AUTH_OPENID_ENABLED: 1
#      VIKUNJA_AUTH_OPENID_REDIRECTURL:
      VIKUNJA_AUTH_OPENID_PROVIDERS_NAME: "VIKUNJA"
      VIKUNJA_AUTH_OPENID_PROVIDERS_VIKUNJA_AUTHURL: "https://URL/application/o/vikunja/"
      VIKUNJA_AUTH_OPENID_PROVIDERS_VIKUNJA_CLIENTID: "CLIENTID" 
      VIKUNJA_AUTH_OPENID_PROVIDERS_VIKUNJA_CLIENTSECRET: "CLIENSECRET"
Hello and sorry for my probably stupid question: How do I set up a custom auth-provider via environment-variables? This is my setup: ```yaml environment: VIKUNJA_AUTH_LOCAL_ENABLED: 1 VIKUNJA_AUTH_OPENID_ENABLED: 1 # VIKUNJA_AUTH_OPENID_REDIRECTURL: VIKUNJA_AUTH_OPENID_PROVIDERS_NAME: "VIKUNJA" VIKUNJA_AUTH_OPENID_PROVIDERS_VIKUNJA_AUTHURL: "https://URL/application/o/vikunja/" VIKUNJA_AUTH_OPENID_PROVIDERS_VIKUNJA_CLIENTID: "CLIENTID" VIKUNJA_AUTH_OPENID_PROVIDERS_VIKUNJA_CLIENTSECRET: "CLIENSECRET" ```

I think you will need to do this as a json inside the VIKUNJA_AUTH_OPENID_PROVIDERS variable since this is parsed by the configuration library and further parsed later on in a custom handler (but the custom handler is not able to extract those values further from ENV variables)

But if we get an answer here, we should definitely add this to the documentation.

I think you will need to do this as a json inside the `VIKUNJA_AUTH_OPENID_PROVIDERS` variable since this is parsed by the configuration library and further parsed later on in a custom handler (but the custom handler is not able to extract those values further from ENV variables) But if we get an answer here, we should definitely add this to the documentation.
Owner

Currently you can't configure an openid provider only with environment variables. You'll need to mount a config file for that.
This is caused by viper (the config library we're using) can't handle arrays with env variables.

Open for ideas how this should be possible to use.

Currently you can't configure an openid provider only with environment variables. You'll need to mount a config file for that. This is caused by viper (the config library we're using) can't handle arrays with env variables. Open for ideas how this should be possible to use.
konrad added the
kind/feature
label 2021-09-21 19:38:01 +00:00
Author

That's very unfortunate...
Shall I close this issue?

That's very unfortunate... Shall I close this issue?
Owner

Shall I close this issue?

I mean, you can leave it open until we have a good idea how to fix this, but I don't think that would happen anytime soon. (That is, unless you want to send a PR ofc)

> Shall I close this issue? I mean, you can leave it open until we have a good idea how to fix this, but I don't think that would happen anytime soon. (That is, unless you want to send a PR ofc)
Owner

Possibly related: vikunja/api#881

Possibly related: https://kolaente.dev/vikunja/api/issues/881

This is the only configuration that cannot be done using environments variables, which is a shame ;)

This is the only configuration that cannot be done using environments variables, which is a shame ;)
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#978
No description provided.