Add Authentik forward auth support

This commit is contained in:
Joker
2025-03-01 15:29:36 +08:00
parent 2e9d70da83
commit ebf6ad6600
9 changed files with 262 additions and 2 deletions

View File

@@ -115,6 +115,7 @@ func ReverseProxtInit() {
WebDirectory: *path_webserver,
AccessController: accessController,
AutheliaRouter: autheliaRouter,
AuthentikRouter: authentikRouter,
LoadBalancer: loadBalancer,
Logger: SystemWideLogger,
})
@@ -578,6 +579,8 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) {
newProxyEndpoint.AuthenticationProvider.AuthMethod = dynamicproxy.AuthMethodAuthelia
} else if authProviderType == 3 {
newProxyEndpoint.AuthenticationProvider.AuthMethod = dynamicproxy.AuthMethodOauth2
} else if authProviderType == 4 {
newProxyEndpoint.AuthenticationProvider.AuthMethod = dynamicproxy.AuthMethodAuthentik
} else {
newProxyEndpoint.AuthenticationProvider.AuthMethod = dynamicproxy.AuthMethodNone
}