#Authentik Regex for unauthenticated URLs with Forward Auth Proxy Provider

1 messages · Page 1 of 1 (latest)

shy parcel
hexed sun
#

In my experience as long as you escaped the question mark it should be fine

#

also the regex in your reddit post doesn't look right

\/.*\?dl=.*

I tested this using regexr.com

shy parcel
#

thank you for your answer, I tested the regex too in this tester and came to the same solution as you, but this didn't work
I changed the regex for the unauthenticated path; see below -> it doesn't match

what I learned through my testing, that the first slash does not need to be escaped with such as \/ and everyhting after a question mark isn't queried, as shown in the logs down below

trace | event=nginx forwarded url logger=authentik.outpost.proxyv2.application name=Wastebin timestamp=2025-01-04T06:18:01+01:00 url=https://app.mydomain.coml/j595b?dl=cpp
trace | event=Matching URL against allow list logger=authentik.outpost.proxyv2.application match=false name=Wastebin regex=\/.*\?dl=.* timestamp=2025-01-04T06:18:01+01:00 url=/lj595b 
trace | event=Matching URL against allow list logger=authentik.outpost.proxyv2.application match=false name=Wastebin regex=^/.*\..*$ timestamp=2025-01-04T06:18:01+01:00 url=/lj595b 
trace | event=Matching URL against allow list logger=authentik.outpost.proxyv2.application match=false name=Wastebin regex=^/burn/.*$ timestamp=2025-01-04T06:18:01+01:00 url=/lj595b 
INF | event=/outpost.goauthentik.io/auth/nginx host=bin.mahrnet.ch logger=authentik.outpost.proxyv2.application method=GET name=Wastebin remote=10.46.98.11:57610 runtime=1.458 scheme=http size=21 status=401 timestamp=2025-01-04T06:18:01+01:00 user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0 

hexed sun
shy parcel
#

the regex I use to match url=/lj595b is ^/[\w+-]{6,7}$
^ = beginning
[\w+-]{6,7} = alphanumeric string with - and +, min length 6 and max length 7 characters
$ = ending
it works for now, but I don't think that this is intended behaviour of authentik

hexed sun
#

its only looking at the Path rather than the URI