0

I'm trying to use rlm_python to authenticate client with my backend.

The problem is, it seems I could not use different modules for different virtual servers and it cause my authentication backed threat all authentication request as default virtual server.

So the question is: Is there any way to pass a variable to module to inform the current virtual server port address?

For example something like this:

update control {
       Auth-Type := `/usr/bin/python /etc/test.py '%{User-Name}' '%{User-Password}' '#{virtual-server}'`
}
masegaloeh
  • 17,978
  • 9
  • 56
  • 104
max
  • 3
  • 1

1 Answers1

0

You can use %{Packet-Dst-Port} which will expand to the destination port in the received UDP packet.

To access it in the rlm_python module you'd need to do something like:

update request {
    Packet-Dst-Port := "%{Packet-Dst-Port}"
}
python

To convert it to a real attribute first.

Arran Cudbard-Bell
  • 1,514
  • 1
  • 9
  • 18