H2CK / webtrees

Docker Image containing Webtrees
Apache License 2.0
36 stars 9 forks source link

Custom authentication header #51

Closed Izanagi52 closed 2 years ago

Izanagi52 commented 2 years ago

Hello, Is it possible to add an option to set a custom authentication header instead of REMOTE_USER ? For example, Authentik use another header : X-Authentik-Username Thanks !

(Sorry for my bad English, it's not my native language)

H2CK commented 2 years ago

authnetik supports custom headers which allow to define the REMOTE_USER header required by this webtrees image. See: https://goauthentik.io/docs/providers/proxy/custom_headers Might it be a solution to just create a custom header as shown here? You just have to replace the X-App-User with REMOTE_USER.

In parallel I will check if the used header variable could be made configurable easily.

BTW: No need apologize for your English

H2CK commented 2 years ago

Implementation for stable Webtrees 2.0 branch: https://github.com/H2CK/webtrees/pull/52 Implementation for beta Webtrees 2.1 branch will follow.

Details on implementation: You can set the used header with the environment variable -e HEADER_AUTH_VAR=YOUR-VAR-NAME

Updated image will be available soon on docker hub (v2.0.23-1).

H2CK commented 2 years ago

Images for stable (latest) and beta with this extension are available at docker hub.

Izanagi52 commented 2 years ago

It's perfect! Thanks!

And I have already seen the custom header in authentic, but I haven't managed to make it works...

Anyway, it's works perfectly for me, thanks for your works !