Environment-variable for openid-provider #978

Open
opened 1 year ago by mawoka · 4 comments
mawoka commented 1 year ago

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 1 year ago
Poster

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)
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/api#978
Loading…
There is no content yet.